Код: Выделить всё
CREATE TABLE WORDS (
ID INTEGER NOT NULL,
WRD VARCHAR(50) NOT NULL
);
ALTER TABLE WORDS ADD CONSTRAINT PK_WORDS PRIMARY KEY (ID);
CREATE UNIQUE INDEX WORDS_IDX1 ON WORDS (WRD);
Делаю запрос с параметром :par
Код: Выделить всё
select id, wrd from words where wrd like :par||'%'
Plan
PLAN (WORDS NATURAL)
Adapted Plan
PLAN (WORDS NATURAL)
------ Performance info ------
Prepare time = 15ms
Execute time = 32ms
Avg fetch time = 3,56 ms
Current memory = 3 067 048
Max memory = 3 201 964
Memory buffers = 12 048
Reads from disk to cache = 65
Writes from cache to disk = 6
Fetches from cache = 15 150
Этап 2.
Убираю из запроса параметр и прописываю условие в явном виде
Код: Выделить всё
select id, wrd from words where wrd like 'А%'
Plan
PLAN (AUTHORS INDEX (AUTHORS_IDX1))
Adapted Plan
PLAN (AUTHORS INDEX (AUTHORS_IDX1))
------ Performance info ------
Prepare time = 0ms
Execute time = 31ms
Avg fetch time = 7,75 ms
Current memory = 3 112 648
Max memory = 3 247 564
Memory buffers = 12 048
Reads from disk to cache = 10
Writes from cache to disk = 6
Fetches from cache = 293
================
Посему вопрос. Почему планы различаются? Ведь п сути запросы абсолютно одинаковы.
Это баг или фича.
FB Server 1.5.3