List:General Discussion« Previous MessageNext Message »
From:Steve Meyers Date:January 18 2011 1:55am
Subject:Re: Rewrite SQL to stop table scan
View as plain text  
On 1/17/11 9:52 AM, Jerry Schwartz wrote:
> [JS] I don't understand how an index on a timestamp would help. Theoretically,
> each record could have a unique value for the timestamp; so the index would
> have an entry for each record. Would MySQL really use that in preference to,
> or in combination with, an index on devid?

You are correct.  The ideal index would be across (devid, stamp).
Thread
Rewrite SQL to stop table scanBruce Ferrell14 Jan
  • Re: Rewrite SQL to stop table scanJohan De Meersman14 Jan
  • Re: Rewrite SQL to stop table scanYogesh Kore14 Jan
  • Re: Rewrite SQL to stop table scanYogesh Kore14 Jan
  • Re: Rewrite SQL to stop table scanPeter Brawley14 Jan
  • Re: Rewrite SQL to stop table scanSteve Meyers14 Jan
    • Re: Rewrite SQL to stop table scanBruce Ferrell15 Jan
      • RE: Rewrite SQL to stop table scanJerry Schwartz17 Jan
        • Re: Rewrite SQL to stop table scanSteve Meyers18 Jan
  • RE: Rewrite SQL to stop table scanJerry Schwartz14 Jan