Jump to content

[SOLVED] Simple optimisation


robbyc

Recommended Posts

Hi

 

I have a very simple table with three columns an id column type int auto increment, a url column type varchar(500) and serach_term varchar(200).

 

The table has about 50000 rows and I query it by

 

select query_url from invalid_queries where query_url = 'query_url';

 

This is very slow, I have added an index but this doesn't seem to have helped.

 

Can anyone please tell me how to optimise this table and query?

 

I am actually only concerned with whether the row exists or not and in my php use mysql_num_rows to give me my result, would count(*) be more efficient?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/38189-solved-simple-optimisation/
Share on other sites

Hello

 

after further investigation and reading I realised that my index should have made a vast improvement. I had created it using the mysql gui after I deleted it and recreated it using the command line the number of rows being examined dropped from ~30000 to 22. Sorting out the bottleneck in my application.

 

Thanks for you help anyway

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.