MySQL Forums :: Newbie :: What is quicker for searching out of these two?


Advanced Search

What is quicker for searching out of these two?
Posted by: Shaun Thomson ()
Date: January 25, 2013 09:03AM

Gidday

I'm setting up basic tagging for a song list system, and thought some experienced input before I go delving into setting up the system would be beneficial.

I'm adding 50s, 60s, 70s, 80s etc, so users can select one to include in the search query.

I'm wondering which would be quicker for queries:

1. assign each decade a number eg 50s = 1, 60s = 2, and store the number in a `decades` column - queries would include eg - "AND `decades` = 3"

or

2. have a char(0) column for each decade, set default to null, and set the relevant column to an empty string, so a query for an 80s search would include "AND `80s` ='' "

Also, just wondering if the amount of columns in a table affect search speed? I have other tags to add (about 50), and if option 2 above is quicker, I was thinking of adding 50 columns using the char(0) method (of which up to four would be queried at any one time).

Thanks for your input.

Options: ReplyQuote


Subject Written By Posted
What is quicker for searching out of these two? Shaun Thomson 01/25/2013 09:03AM
Re: What is quicker for searching out of these two? Rick James 01/27/2013 12:01AM
Re: What is quicker for searching out of these two? Rick James 01/27/2013 12:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.