From: | Denis de Bernardy <ddebernardy(at)yahoo(dot)com> |
---|---|
To: | PG Performance <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: row estimate very wrong for array type |
Date: | 2011-05-04 14:56:52 |
Message-ID: | 600933.65939.qm@web112414.mail.gq1.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
> ----- Original Message -----
>> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>> To: Denis de Bernardy <ddebernardy(at)yahoo(dot)com>
>> Cc: "pgsql-performance(at)postgresql(dot)org"
> <pgsql-performance(at)postgresql(dot)org>
>> Sent: Wednesday, May 4, 2011 4:12 PM
>> Subject: Re: [PERFORM] row estimate very wrong for array type
>>
>> Array && uses areasel() which is only a stub :-(
On a separate note, in case this ever gets found via google, I managed to force the use of the correct index in the meanwhile:
# explain analyze select * from test where (0 = any(intarr1) or 1 = any(intarr1)) and (2 = any(intarr2) or 4 = any(intarr2)) order by sortcol limit 10;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.00..385.16 rows=10 width=217) (actual time=0.107..0.151 rows=10 loops=1)
-> Index Scan using test_sortcol_key on test (cost=0.00..14019.98 rows=364 width=217) (actual time=0.106..0.146 rows=10 loops=1)
Filter: (((0 = ANY (intarr1)) OR (1 = ANY (intarr1))) AND ((2 = ANY (intarr2)) OR (4 = ANY (intarr2))))
Total runtime: 0.214 ms
I guess I'm in for maintaining counts and rewriting queries as needed. :-(
D
From | Date | Subject | |
---|---|---|---|
Next Message | Jim Nasby | 2011-05-04 15:40:25 | Re: Shouldn't we have a way to avoid "risky" plans? |
Previous Message | Denis de Bernardy | 2011-05-04 14:42:53 | Re: row estimate very wrong for array type |