Hi Kelly,
| I am writting a search engine using Mysql. I am trying to return
| a text object value (which contains all of the html), but it is
| taking about 10 seconds to return each text value matching my
query.
| Is there any way that a text value can be optimized?
An SQL query example of what you are doing currently would have been
useful. Are you using '%LIKE%' for "matching"? Or is it taking 10
seconds for normal selects as well?
I assume there is a good reason why you are storing the whole HTML in
your database, because it includes a whole bunch of redundant tags,
links etc. Editing your page may become one hell of a chore very soon
(e.g., if you just need to update a link!).
But anyway, as for the text stuff try the INSTR function
(http://snipurl.com/instr) and see if that helps? Perhaps you could take
a look at regular expressions in some way too
(http://snipurl.com/mysql_regexp) but am not sure how useful that is
unless I know your table structure.
Meanwhile, you could also try a slightly different approach of having a
separate HTML_SEARCH table which maintains a link to the html blobs in
your current table, but saves ONLY the content (no html tags etc). This
way, the db does not have to search for a whole bunch of redundant tags
but still would have a link to your current html files which are saved
in a separate table that is used only for a layout.
Hope this helped,
Shanx
--
Shashank Tripathi
www.shanx.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php