BUG #3701: Don't work intarray GIN indexes

Started by girlaover 18 years ago2 messagesbugs
Jump to latest
#1girla
girla@online.ua

The following bug has been logged online:

Bug reference: 3701
Logged by: girla
Email address: girla@online.ua
PostgreSQL version: 8.3beta1
Operating system: Windows XP Proffesional SP2
Description: Don't work intarray GIN indexes
Details:

8.3beta1 never used intarray GIN indexes.

The same test case:

EXPLAIN
SELECT *
FROM intarr
WHERE (arr && ARRAY[132,20,78,45,457]);

on 8.2:
--------------------
"Bitmap Heap Scan on intarr (cost=4.33..37.45 rows=10 width=64)"
" Recheck Cond: (arr && '{132,20,78,45,457}'::integer[])"
" -> Bitmap Index Scan on i_arr_gin (cost=0.00..4.33 rows=10 width=0)"
" Index Cond: (arr && '{132,20,78,45,457}'::integer[])"

and on 8.3beta1:
---------------------
"Seq Scan on intarr (cost=0.00..238.00 rows=10 width=58)"
" Filter: (arr && '{132,20,78,45,457}'::integer[])"

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: girla (#1)
Re: BUG #3701: Don't work intarray GIN indexes

"girla" <girla@online.ua> writes:

8.3beta1 never used intarray GIN indexes.

Works for me:

contrib_regression=# \d test__int
Table "public.test__int"
Column | Type | Modifiers
--------+-----------+-----------
a | integer[] |
Indexes:
"text_idx" gin (a gin__int_ops)

contrib_regression=# SELECT count(*) from test__int WHERE a && '{23,50}';
count
-------
403
(1 row)

contrib_regression=# explain SELECT count(*) from test__int WHERE a && '{23,50}';
QUERY PLAN
-----------------------------------------------------------------------------
Aggregate (cost=25.18..25.19 rows=1 width=0)
-> Bitmap Heap Scan on test__int (cost=4.31..25.16 rows=7 width=0)
Recheck Cond: (a && '{23,50}'::integer[])
-> Bitmap Index Scan on text_idx (cost=0.00..4.31 rows=7 width=0)
Index Cond: (a && '{23,50}'::integer[])
(5 rows)

contrib_regression=#

(This is using the database set up by contrib/intarray's regression
test.)

So if you want help you're going to need to provide much more detail,
like say your *whole* test case.

regards, tom lane