Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indexing Question Version Prior to MySQL 3.23

Status
Not open for further replies.

weldonj

Programmer
Jul 8, 2000
3
US
I read that in versions of mysql prior to 3.23 (my host has 3.21 I believe), that if you want mysql to use an index you must "use columns of the same type for comparison purposes" otherwise MySql won't use the index.
I'm confused exactly what this means, and how it will affect me.

Say I have a table with many columns among which are the columns category(varchar) and time(time). Ideally, I will be selecting from the various categories based on time. So let's say that I want to select the most 5 entries of category X. I would do a select on category X ordered by time- I assume. Assuming this is the case, my question is about the indexing. Does this statement at the top mean it will just waste space to index? If not, should I index category and time separately. or as one index.

I hope this makes sense. It would be a lot easier I think my host had 3.23.

A completely unrelated question is, do you need to index set or enum column types?

And thanks for the help in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top