Quantcast
Viewing all articles
Browse latest Browse all 35

preferred order of columns in the key

If I have a table like so:

table T ( account_id bigint, event_date datetime ... );

and later make queries like so:

select ...from Twhere account_id = 'ABC'  and event_date >= '2016-01-01'

Does the order of columns in the index matter, ie:

key (`account_id`, `event_date`)

Or

key (`event_date`, `account_id`)

Thanks!


Viewing all articles
Browse latest Browse all 35

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>