Re: [GENERAL] Index not used when using expression

2017-11-09 Thread Tom Lane
Dingyuan Wang writes: > I have a table named "gps", with an indexed column "packettime", which > has unix timestamps. > The following query: > select * from gps where packettime < extract(epoch from '2017-05-01 > 08:00+08'::timestamp with time zone) > explains to: > Seq Scan

[GENERAL] Index not used when using expression

2017-11-09 Thread Dingyuan Wang
Hi, I have a table named "gps", with an indexed column "packettime", which has unix timestamps. The following query: select * from gps where packettime < extract(epoch from '2017-05-01 08:00+08'::timestamp with time zone) explains to: Seq Scan on gps (cost=0.00..43411860.64 rows=384325803