Mark Kirkwood wrote:
I'm seeing a segfault on a size TPC-H size 10 database. The patch and
code are:
- bitmap patch from 12 Mar
- 8.3 dev from 27 Mar
SELECT count(distinct(o_orderkey))
FROM orders orders_alias
WHERE o_orderpriority IN ('1-URGENT', '3-MEDIUM') AND o_orderstatus='P';
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x08155eb5 in bitmap_stream_free (opaque=0x84e4070) at tidbitmap.c:1336
#2 0x08142914 in ExecEndBitmapHeapScan (node=0x8405548)
at nodeBitmapHeapscan.c:463
#3 0x0813789a in ExecutorEnd (queryDesc=0x83ed948) at execMain.c:992
#4 0x081134ef in PortalCleanup (portal=0x83ee018) at portalcmds.c:302
#5 0x0823e2d2 in PortalDrop (portal=0x83ee018, isTopCommit=0 '\0')
at portalmem.c:382
#6 0x081b2182 in exec_simple_query (
query_string=0x83a8018 "SELECT count(distinct(o_orderkey))\nFROM
orders orders_alias\nWHERE o_orderpriority IN ('1-URGENT', '3-MEDIUM')
AND o_orderstatus='P';") at postgres.c:964
#7 0x081b4350 in PostgresMain (argc=4, argv=0x833a638,
username=0x833a610 "postgres") at postgres.c:3488
#8 0x0818faab in ServerLoop () at postmaster.c:2985
#9 0x081911b1 in PostmasterMain (argc=1, argv=0xbfbfec30) at
postmaster.c:967
#10 0x08153592 in main (argc=1, argv=0xbfbfec30) at main.c:188
Not a SIGSEGV but another stream related issue:
bitmap=# \d bitmaptest;
Table "public.bitmaptest"
Column | Type | Modifiers
--------+---------+-----------
id | integer | not null
val0 | integer |
val1 | integer |
val2 | integer |
fil | text |
Indexes:
"bitmaptest_id" btree (id)
"bitmaptest_val0" bitmap (val0)
"bitmaptest_val1" bitmap (val1)
"bitmaptest_val2" bitmap (val2)
bitmap=# SELECT count(*) FROM bitmaptest
WHERE val1 in (1,7)
AND val0 IN (4,3)
;
ERROR: XX000: unknown stream type 2
LOCATION: stream_add_node, tidbitmap.c:1033
I could not reproduce this with the TPC-H dataset, so here's a link to
the files to generate this one:
http://homepages.paradise.net.nz/markir/download/bizgres/bitmaptest.tar.gz
Cheers
Mark
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match