GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   mysql optimizing table question (https://gfy.com/showthread.php?t=594955)

alex79 04-06-2006 02:47 AM

mysql optimizing table question
 
I have a table with next structure:

Code:

CREATE TABLE `table` (
`keywords` TEXT NOT NULL
) TYPE = MYISAM ;

where the rows are like:
row1: keyword1,keyword2,keyword5,...
row2: keyword10,keyword435,keyword5123,keywordn...


i want to make selects like this:


Code:

select * from `table` where `keywords` like '%keyword2%'

how do i optimize the `table` for a such selects? if i create an index on `keywords` column don't help becouse index are created after the firsts characters from column and are useful for selects with where `keywords` like 'keyword2%' not for selects with where `keywords` like '%keyword2%'

How can optimize the table for a such select?

darksoul 04-06-2006 02:59 AM

http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html

darksoul 04-06-2006 03:03 AM

also another option (fastest) would be
table keywords (entry_id int auto_increment, keywords text, primary key(entry_id))
table keywords_index (keyword varchar(16), simulated_array varchar(256))
where simulated_array would reference table keywords
its more work but its the fastest for search


All times are GMT -7. The time now is 01:14 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123