lpxxfaintxx Posted August 23, 2006 Share Posted August 23, 2006 I have a database of the english dictionary. I was wondering how I should set up my db...Should I make 1 table and insert all the words in there (a LOT of words)-- or should I make 26 tables, for each letter of the alphabet. Would the second choice make the queries run faster?Thanks Quote Link to comment Share on other sites More sharing options...
Woolf Posted August 23, 2006 Share Posted August 23, 2006 I would think the second choice (26 tables) would be better, but that's just my opinion. My reasoning behind this is:If you were to use one table, with hundreds of thousands of words... that'd be a big table, right? Well, just think... in order to query the results by letter, you would either have to a) create a 'first letter' column or b) pull all the results from the table and then check to see if they contain the correct first letter. Even if you were to use the 'first letter' column, you would still have to use extra processing by using WHERE first_letter='x' (where x is the letter).So, if you were to use 26 separate tables, when you run your query you would just have to do it like normal. (SELECT * FROM letter_x ORDER BY word ASC) That's really quite simple, and I would think that it would be much faster. Especially with pagination. Quote Link to comment Share on other sites More sharing options...
fenway Posted August 23, 2006 Share Posted August 23, 2006 That really depends on what you're using it for... you do really want to query 13 different tables? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.