473,569 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

fast keyword search - suggestions asked

Hi Everyone,

I´m asked to "speed up" a keyword search based on MySQL.
The material i´m given to work with is a quite large MySQL table with
1.5 mio rows, defined something like:

CREATE TABLE datarecords (
id BIGINT(20) NOT NULL auto_increment,
[3-4 other INT type columns],
keywords TEXT NOT NULL,
updated TIMESTAMP(14) NOT NULL,
PRIMARY KEY (id)) TYPE=MyISAM;

The search requires the id-fields of the datarecords table to be
returned, based on keywords within the keywords-field, like so:

SELECT id FROM datarecords WHERE (
(keywords LIKE '%someword%' AND keywords LIKE '%otherword%')
AND
(keywords NOT LIKE '%notthisword%' AND keywords NOT LIKE
'%thisneither%' )
)

The table has grown unexpectedly large and will keep growing, so a
different method for keyword searching appears to be required, since
search-speed has decreased significantly (now at about 12 secs,
depending an the number of searched keywords)

Using FULLTEXT indexing has brought no performance increase...

Question:
Does anybody have any suggestion on how to tackle this type of
problem, to get search-speed down to about 2-3 secs?

One way i´m looking at this is to create a seperate keyword-table
something like this:

CREATE TABLE testkwdlist (
keyword varchar(32) NOT NULL default '',
ids text NOT NULL,
PRIMARY KEY (keyword)
) TYPE=MyISAM;

and filling this table up with the keywords and listing the IDs in the
ids-field, doing seperate queries for the positive and negative
searches and compiling the actual resultset in code...

Does this sound it has potential for a performance boost or is it
competely insane?

Any comments gladly appreciated! I will try out and report about any
sane suggestion!

Thanks in advance,

Torfi

Some basis-data:
MySQL 4.0.15, Suse 9.0, kernel 2.4.21-215-smp4G
on dual 3,6GHz XEON, 4GB RAM, enough disk.
Jul 20 '05 #1
2 2714
I would suggest to real "select statement needed"
started a few days a go on this newsgroup.

I'll test the method next week (I hope).

Wouter
"Torfi Sackbatten" <to*******@exsi teing.com> wrote in message
news:96******** *************** ***@posting.goo gle.com...
: Hi Everyone,
:
: I´m asked to "speed up" a keyword search based on MySQL.
: The material i´m given to work with is a quite large MySQL table with
: 1.5 mio rows, defined something like:
:
: CREATE TABLE datarecords (
: id BIGINT(20) NOT NULL auto_increment,
: [3-4 other INT type columns],
: keywords TEXT NOT NULL,
: updated TIMESTAMP(14) NOT NULL,
: PRIMARY KEY (id)) TYPE=MyISAM;
:
: The search requires the id-fields of the datarecords table to be
: returned, based on keywords within the keywords-field, like so:
:
: SELECT id FROM datarecords WHERE (
: (keywords LIKE '%someword%' AND keywords LIKE '%otherword%')
: AND
: (keywords NOT LIKE '%notthisword%' AND keywords NOT LIKE
: '%thisneither%' )
: )
:
: The table has grown unexpectedly large and will keep growing, so a
: different method for keyword searching appears to be required, since
: search-speed has decreased significantly (now at about 12 secs,
: depending an the number of searched keywords)
:
: Using FULLTEXT indexing has brought no performance increase...
:
: Question:
: Does anybody have any suggestion on how to tackle this type of
: problem, to get search-speed down to about 2-3 secs?
:
: One way i´m looking at this is to create a seperate keyword-table
: something like this:
:
: CREATE TABLE testkwdlist (
: keyword varchar(32) NOT NULL default '',
: ids text NOT NULL,
: PRIMARY KEY (keyword)
: ) TYPE=MyISAM;
:
: and filling this table up with the keywords and listing the IDs in the
: ids-field, doing seperate queries for the positive and negative
: searches and compiling the actual resultset in code...
:
: Does this sound it has potential for a performance boost or is it
: competely insane?
:
: Any comments gladly appreciated! I will try out and report about any
: sane suggestion!
:
: Thanks in advance,
:
: Torfi
:
: Some basis-data:
: MySQL 4.0.15, Suse 9.0, kernel 2.4.21-215-smp4G
: on dual 3,6GHz XEON, 4GB RAM, enough disk.
Jul 20 '05 #2
: I would suggest to real "select statement needed"
: started a few days a go on this newsgroup.

I mean read articles with the subject "select statement needed"

seems I can't type well today.
Wouter
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1939
by: Andre | last post by:
Hello, I am working on refactoring my companies search engine, and a critical component of the search is that the results be displayed very quickly. We have done enourmous work on making the queries fast (under 1 second), but the bottleneck always seems to be how we process the results into HTML and send them to the users web browser. ...
6
3323
by: DC | last post by:
Hi, I am programming a search catalogue with 200000 items (and growing). I am currently using the SQL Server 2000 fulltext engine for this task but it does not fit the requirements anymore. The products typically do have a verbose name, "canadian superapples: red tasty juicy macintosh apple from toronto" and the like. If a customer is...
25
2554
by: samjnaa | last post by:
Please check for sanity and approve for posting at python-dev. In Visual Basic there is the keyword "with" which allows an object- name to be declared as governing the following statements. For example: with quitCommandButton .enabled = true .default = true end with
2
2661
by: rlemusic | last post by:
Hi everybody, I’m creating a database in Access (I believe it’s 2000) to catalogue items in the archives of a small museum. I’m a total n00b as far as using Access goes, but by looking at some online tutorials and how the museum’s existing collections catalogue is set up in Access, I’ve been able to come up with a basic database that suits the...
12
2968
by: paitoon | last post by:
Hi, I got a little bit problem about search result in my site. When i put the keyword and click on search ....everything work fine i got the correct result but they not order by the keyword,but they order by the alphabet.....some and the problem is happen sure if there are many result to display...the real result that people put keyword for...
3
5385
by: Redbeard | last post by:
Hi All this is my first time post, be gentle. I am looking at creating a keyword search that searches multiple fields in a Form and then filters records that match the keyword. The Form currently has a button that connects to a Query that run the keyword search in several field and then filters the results. The problem is that I can not do a...
5
3361
by: kanley | last post by:
I have a main table with a text description field. In this field, its populated with a string of data. I need to identify from this string of data the name of the vendor using some keywords. I have another table that contains 2 fields, one being the keywords to search for from the string of data and the other field being the vendor name...
1
3131
by: prasath03 | last post by:
Hi Gurus, I am doing one website project that project contains one search module. In that search page i have entered the keyword to search. If i want to search the keyword with "any keyword" or "all keyword" after searched the records are showed. what i expecting is i want to hightlight the all keyword in that page with case insensitive. I...
1
2772
by: alamodgal | last post by:
hiiiiiii I have a problem in highlighting searching keyword.Actually im using this function for searching Public Function HighLight(ByVal Keyword As String, ByVal ContentFor As String) Dim objHighLight As New highlight(Keyword, "<span class='searchKeyword'>{keyword}</span>") ContentFor = objHighLight.process(ContentFor, False,...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6286
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3656
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.