For 'fun' I've written a little search engine in PHP & MySQL which is generally working pretty nicely. Problem is that it takes ages to fetch the results when you search.
I've removed referrer table from the queries for now to eliminate it from the potential problem causes so my query is something like this:
select * from pages where pagedata like '%searchtext%' and pagedata like '%someotherkeyword%';
I have only around 100,000 records in the table and it takes over 30s to return my results.
Structure of the table is really simple, like this:
table: pages
field: id type: int
field: pageaddress type: varchar(255)
field: pagedata type: text
Is there anything that can be done to optimise this? I know the basics of optimising using indexes, but can't seem to improve the runtime of this at all...
Question
hornett
For 'fun' I've written a little search engine in PHP & MySQL which is generally working pretty nicely. Problem is that it takes ages to fetch the results when you search.
I've removed referrer table from the queries for now to eliminate it from the potential problem causes so my query is something like this:
I have only around 100,000 records in the table and it takes over 30s to return my results.
Structure of the table is really simple, like this:
table: pages
field: id type: int
field: pageaddress type: varchar(255)
field: pagedata type: text
Is there anything that can be done to optimise this? I know the basics of optimising using indexes, but can't seem to improve the runtime of this at all...
Thanks!
Link to comment
Share on other sites
1 answer to this question
Recommended Posts