sqlite schema CREATE TABLE az_data az_id INTEGER NOT NULL series INTEG

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
sqlite> .schema
CREATE TABLE az_data (
az_id INTEGER NOT NULL,
series INTEGER NOT NULL,
number INTEGER NOT NULL,
surname VARCHAR(80),
first_name VARCHAR(80),
last_name VARCHAR(80),
birthday DATE,
is_active BOOLEAN NOT NULL,
need_to_change BOOLEAN,
date_from DATE,
date_till DATE,
PRIMARY KEY (az_id),
CONSTRAINT c_uniq_policies UNIQUE (series, number)
);
CREATE UNIQUE INDEX ix_az_data_az_id ON az_data (az_id);
CREATE INDEX ix_az_data_first_name ON az_data (first_name);
CREATE INDEX ix_az_data_number ON az_data (number);
CREATE INDEX ix_az_data_series ON az_data (series);
CREATE INDEX ix_az_data_surname ON az_data (surname);
sqlite> select * from az_data where surname = 'ЮРЕВИЧ' and first_name = 'ЮРИЙ';
-- и вот этот запрос нифига не использует индексы, а делает raw scan