select Url from table where Ref = 'foo'
Salada, Duncan wrote:
>I am hoping I can get some help with a difficulty I am having with a table
>of mine. I am going to give a lot of background info, so please bear with
>me. First, let me say that I using 3.23.49. Now some info about the table.
>It currently has 5687391 rows. There are 3 columns in the table: ID (int),
>Url (varchar(255)), and Ref (varchar(255)). There are two indexes for the
>table: one on ID and the other on the first 15 characters of Ref.
>Now my problem: select queries on this table with no joins searching for a
>constant in the Refs column only are extremely slow. Here is what all the
>sql statements look like "select Url from table where Ref like 'foo'".
>Pretty simple right? Here's the deal this table is used only by a little
>app that I wrote. Each time the app runs it queries this table as shown
>above about 4600 times with different values for "foo". Each query seems to
>be taking about 2 minutes to execute. This seems odd to me because I tested
>it while I was writing the app and the queries were taking a little over a