Subject | can someone explain me |
---|---|
Author | svanderclock |
Post date | 2009-06-23T18:38:28Z |
i have this query :
Select
First 15
ID
FROM GEO_PLACE
WHERE
ID = 'RU'
=> time taken 2ms
PLAN (GEO_PLACE INDEX (RDB$PRIMARY24))
now if i do
Select
First 15
ID
FROM GEO_PLACE
WHERE
ID like 'RU'
=> time taken 1230ms
PLAN (GEO_PLACE INDEX (RDB$PRIMARY24))
now if i do
Select
First 15
ID
FROM GEO_PLACE
WHERE
ID like 'R%'
=> time taken 80ms
PLAN (GEO_PLACE INDEX (RDB$PRIMARY24))
Why with the like clause it's soo long ??
the geo_place table have 500 000 record and
only 1 record = RU and
200000 record like 'r%' (but i want only the
first 15, so it's must be faster than 80ms!)
ID = varchar(100)
how to optimize my table? probably something wrong in it ?
thank you by advance
stephane
Select
First 15
ID
FROM GEO_PLACE
WHERE
ID = 'RU'
=> time taken 2ms
PLAN (GEO_PLACE INDEX (RDB$PRIMARY24))
now if i do
Select
First 15
ID
FROM GEO_PLACE
WHERE
ID like 'RU'
=> time taken 1230ms
PLAN (GEO_PLACE INDEX (RDB$PRIMARY24))
now if i do
Select
First 15
ID
FROM GEO_PLACE
WHERE
ID like 'R%'
=> time taken 80ms
PLAN (GEO_PLACE INDEX (RDB$PRIMARY24))
Why with the like clause it's soo long ??
the geo_place table have 500 000 record and
only 1 record = RU and
200000 record like 'r%' (but i want only the
first 15, so it's must be faster than 80ms!)
ID = varchar(100)
how to optimize my table? probably something wrong in it ?
thank you by advance
stephane