Jump to content
Larry Ullman's Book Forums

Need Help With Multidimensional Array


Recommended Posts

Well after conducting a quick test (I know its not been repeated, there are many confounding variables and ultimately means nothing) but using SUBSTRING to select all articles beginning with A from a 7000 row dataset took 0.0291 seconds in comparison to 0.3323 seconds using LIKE. I'm sure I could quite easily produce results to the contrary also, depending on the dataset etc... but to me if you want to extract a row that starts with a single character you should test specifically for that character.

 

That said if I was really worried about performance and using a huge dataset I'd probably add another column as a foreign key to represent the letters as then it could be indexed.

 

 

So maybe my table should have each of the letters of the alphabet added as a subset to the Poems field?

Right now I have id, title, poem, category

 

Would it be better to organize more by adding all letters A-Z as a subset of "Title"?

 

Thanks for the help.

Link to comment
Share on other sites

I don't know what everyone thinks but personally I think that would be overkill for what you're trying to achieve - added complexity for no significant benefits. Unless you plan on storing huge numbers of poems e.g. 500,000 plus (number plucked from thin air) I'd stick to querying on the title field - if you've got 1000, 5000, 10000 poems it won't make any noticeable difference to performance.

Link to comment
Share on other sites

 Share

×
×
  • Create New...