Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7429999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:04:15+00:00 2026-05-29T09:04:15+00:00

Need some advice on how to optimize my articles table for read operations. I

  • 0

Need some advice on how to optimize my articles table for read operations. I have articles table where I store articles editors write. There is requirement that editors can enter an article with a date_publish set in future. These articles can not be displayed in cover page at any time until the publish_date has actually come.

So my question here is should I have an index on date_publish field for better performance? I am using MySQL database, with InnoDB engine. I store dates as unixtimestamps in unsigned INT(11) field.

I when I make a read for list articles for cover page I do something like this:

SELECT articles.* FROM articles WHERE date_publish < $time
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:04:16+00:00Added an answer on May 29, 2026 at 9:04 am

    Adding an index on the column date_publish would optimize the following simple query:

    SELECT * FROM articles WHERE date_publish < $time
    

    However, if you change the query, such as add an ORDER clause to order by a column other than date_publish, you may need a compound (multi-column) index to optimize the query.

    EDIT

    To be able to fully utilize an index, a “covering” index must include all columns in the WHERE, JOIN and ORDER clauses, usually in that order. So, if you have a range in your WHERE clause on date_publish, and ORDER BY article_name, then you may wish to index on both columns (date_publish, article_name). That way MySQL can use the index for both selection and sorting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some advice with the Java Print API. I have a program that
I need some advice. (For those who have already read this before I have
Experts - I need some advice in the following scenario. I have a configuration
I have been playing with Compact Framework lately and i need some advice. I
I need some expect advice on how to handle the following:- I have a
I need some advice. I have a web page and want to extend it's
I need some advice on a DB I'm working in. I have the DB,
I need some advice here. I need to make a webservice, that can make
Need some advice, I'm after a decent process/task manager for Ubuntu. Basically I have
Need some advice again please. This is regarding a single developer shop. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.