Forum Moderators: open
If I run the query
SELECT value FROM table WHERE fieldname='fieldvalue'; it runs in about 2.5 seconds the first time and 0.00 seconds the second. I've got query caching on and I assume that would explain the much faster second query. But if I do SELECT value FROM table WHERE fieldname='anothervalue'; as the second query instead of matching it to the first it's still 0.00 seconds. And I don't think a different query would be affected by the cache. I've got an index built on the 'fieldname' field, although this particular table only has about 50 records so I don't know how much difference that really makes.
hth,
mcm
It still seems slow for this query though. The field I'm searching on has a unique key index. The field itself is a varchar(100). Could that slow down the searches? I could probably get away with dropping it to 25 or so and even using a char field type if that would make it faster.
There are about 50 records in the pb_config table.
explain select configvalue from pb_config where configname='company_name'\G*** 1. row ***
id: 1
select_type: SIMPLE
table: pb_config
type: const
possible_keys: name
key: name
key_len: 100
ref: const
rows: 1
Extra:
1 row in set (0.06 sec)
describe pb_config