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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.