<= Index.
От | Greg Sikorski |
---|---|
Тема | <= Index. |
Дата | |
Msg-id | OF33E123C1.30883729-ON80256B8D.0015DC01-80256B8D.0016B750@atomicrevs.net обсуждение исходный текст |
Ответы |
Re: <= Index.
|
Список | pgsql-admin |
How come this Index isn't being used in the situation below? :) The field is an epoch timestamp, and for various reasons it can't be a postgres date/time type ;) It does use the index with a direct = comparison. Cheers, Greg -- cmaster=# explain analyze SELECT user_id,channel_id FROM levels WHERE suspend_expires <= 1017550117; NOTICE: QUERY PLAN: Seq Scan on levels (cost=0.00..13297.38 rows=395082 width=8) (actual time=0.10..6647.88 rows=355869 loops=1) Total runtime: 7492.36 msec cmaster=# \d levels_suspendexpires_idx Index "levels_suspendexpires_idx" Column | Type -----------------+--------- suspend_expires | integer btree -- cmaster=# select min(suspend_expires) from levels; 0 cmaster=# select max(suspend_expires) from levels; 1049662527 cmaster=# select avg(suspend_expires) from levels; 4555730.7985110746
В списке pgsql-admin по дате отправления: