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 6138115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:48:37+00:00 2026-05-23T17:48:37+00:00

Action Keyname Type Unique Packed Column Cardinality Collation Null Comment Edit Drop PRIMARY BTREE

  • 0
Action  Keyname Type    Unique  Packed  Column  Cardinality Collation   Null    Comment
 Edit    Drop   PRIMARY BTREE   Yes No  TickerID    23200   A       
Timestamp   13897209    A   
 Edit    Drop   TickerID    BTREE   No  No  TickerID    11737   A       
 Edit    Drop   Timestamp   BTREE   No  No  Timestamp   18  A       

~99,424,209 InnoDB  utf8_general_ci 5.1 GiB 

OK before I try to “optimize” this DB by deleting unneeded indexes I thought I’d ask here. This table gets hit a lot so I want to speed up insert performance. I read 5 articles on the net that seem to indicate that the single index on TickerID is redundant because the multiple index (TickerID,Timestamp) will be used if I ever run a query on just tickerID.

Occasionally, I will like to do EOD reporting, so that I might just do something like SELECT * WHERE Timestamp > Today() - 1 day or something like that. Do I need the timestamp index as well?

  • 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-23T17:48:37+00:00Added an answer on May 23, 2026 at 5:48 pm

    This index on tickerId, timestamp can be used by all queries which can use an index on tickerId only.

    However, for a query like that:

    SELECT  *
    FROM    mytable
    WHERE   Timestamp > Today() - 1
    

    an index on (tickerId, timestamp) will not be used, since there is no equality filter on tickerId.

    For this query, you should create an index on timestamp only or rewrite thу query:

    SELECT  m.*
    FROM    (
            SELECT  DISTINCT tickerId
            FROM    mytable
            ) md
    JOIN    mytable m
    ON      m.tickerId = md.tickerId
            AND m.timestamp > TODAY() - 1
    

    However, the latter query is less efficient, especially if you have lots of distinct values in tickerId.

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

Sidebar

Related Questions

I make one action method for 2 activities (new input and edit), and there
Is it possible that when I use the getText(keyName); in action class, I can
In my Action, I have an error of type System.MissingMethodException when I use TryUpdateModel.
Action<SPItemEventProperties> deleteAction = DeleteWorkspace; AsyncCallback deleteDone = deleteAction.EndInvoke; SPSecurity.RunWithElevatedPrivileges(() => deleteAction.BeginInvoke(properties, deleteDone, null)); So
Action buttons are added to jqGrid columns using colmodel below. Column width 45 is
Which action/method is in PHPUnit equal to in simpleTest: $this->UnitTestCase('message .....') Edit: Sorry for
My action listener on a JComboBox invokes a thread. I would like the component
this action is generated in symfony 1.2 when you create a module: public function
when they say the action controller in the struts framework is multi threaded, does
I have an action like this: public class News : System.Web.Mvc.Controller { public ActionResult

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.