php - Performance: Put soundex in DB or translate it after the query? -



php - Performance: Put soundex in DB or translate it after the query? -

i relative new in mysql. have forum , writing search function this. query getting entries of forum. want combine search algorithm [similar_text() & soundex()].

my question due performance. improve going save soundex code in database when writing new entry datasae? or improve due performance translate each entry in soundex()?

i using symfony2 framework.

the soundex algorithm designed index anglo-saxon lastly names sound when pronounced in english. if you're trying index forum text--something questions , answers on stackoverflow--instead of names, it's not choice. full text search instead.

having said that, if happen indexing lastly names, you'll probably improve performance storing encoding. ideally, you'd include check constraint guarantee encoding updated if name changed, mysql doesn't enforce check constraints. you'd need write triggers maintain 2 columns in sync.

an alternative on platforms create index on value returned soundex() (or whatever function use). create index on your_table (soundex(your_column));. mysql doesn't back upwards indexes on expressions.

php mysql database performance database-performance

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -