I'm creating a dictionary script for my website and I'm just poundering, what if I would split all words by theyr first letter to difrent tables, would that optimise page loading ?
for e.g. if person searches for somekinde of word, script would take search query first letter and only then parse data from database.
Would that be better or I have missed anything while thinking?
mysql database and php reading
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
you can partial index in mysql as in add an index which only covers the first 2 chars for example.. however unless you running a live search via ajax then it's really of no consequence as you need to search for the whole word anyways.
probably the only way to speed things up is to make a unique index on the "word" column, then read it with a handle.
alternatively, have the whole table stored as a MEMORY table..
probably the only way to speed things up is to make a unique index on the "word" column, then read it with a handle.
alternatively, have the whole table stored as a MEMORY table..