memcached - Improving the performance of Jquery Autocomplete with Sphinx / Memcache....or? -


i have list of 43,000 uk locations in innodb table using populate jquery autocomplete box via remote json calls.

at present i'm performing basic select * locations title 'lond%' query retrieve requests, while site still in development, results coming slow.

i've implimented delay of 200ms between key presses , minimum of 4 chars before starts collecting results, may need re-think there 3 char uk locations , i'd quite display results immediately.

an obvious improvement fulltext index 'title', rest of database innodb i'd rather not go backwards , convert table myisam. therefore i'm left other 2 tools @ disposal sphinx , memcached.

sphinx - remember sphinx returns id's of matching results, i'd still need query mysql every user keypress triggers lookup. therefore i'm not sure how of improvement be?

memcached - had considered loading 43,000 results memory , performing sort of array search (or memcache built-in search if has one?). feels bit idotic? or on thinking it?

i'd appreciate feedback on best route take...

sphinx: store location name in string attribute (ie both field , attribute). run query entirely in sphinx (no need db access). ulimate solution imho. (attributes stored in memory, still storing not big deal)

sphinx + mysql: getting id, , doing primary key lookup on database table should quicker native mysql. quicker if elimate sql , use handlersocket.

memcache: no there no search. key lookups only. perhaps construct key-lookup version, storing possible searches. storing lot, , still have cope misses (in case evicted)

... not differnt sticking memcache in front of sphinx, or mysql. (which if have memcache, might well!)

redis: if wanted implement memory lookup maybe redis work.

(the ironic thing, if using sphinx, memcache or redis, whatever, effectivly creating second 'fast lookup' index. copy of original data table, setup specificly enable searches. in case create duplicate of table in myisam archive same effect, if leave original in innodb)


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -