[GENERAL] pg 10 crashes on int8_avg_combine

2017-11-14 Thread Dingyuan Wang
Hi, PostgreSQL constantly crashes on this query: select dategrid, category, sum(cnt) from v_crime_grid group by dategrid, category; Where v_crime_grid is a materialized view, have columns "dategrid" int4, "category" int4, and "cnt" int8. Version is: PostgreSQL 10.0 on x86_64-pc-linux-gnu, comp

Re: [GENERAL] pg 10 crashes on int8_avg_combine

2017-11-14 Thread Dingyuan Wang
ok, I just avoided it using sum(cnt::int) since cnt is small. 2017-11-15 00:25, Tom Lane: > Dingyuan Wang writes: >> PostgreSQL 10.0 on x86_64-pc-linux-gnu, compiled by gcc (Debian 7.2.0-8) >> 7.2.0, 64-bit >> >> (gdb) bt >> #0 int8_avg_combine (fcinfo=0x5

[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 wid