Re: [HACKERS] [PATCH] Fix ScalarArrayOpExpr estimation for GIN indexes

2011-12-21 Thread Marti Raudsepp
On Wed, Dec 21, 2011 at 03:03, Tom Lane wrote: > I've applied a revised version of this patch that factors things in a > way I found nicer. Nice, thanks! Regards, Marti -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgr

Re: [HACKERS] [PATCH] Fix ScalarArrayOpExpr estimation for GIN indexes

2011-12-20 Thread Tom Lane
Marti Raudsepp writes: > On Tue, Dec 20, 2011 at 07:08, Tom Lane wrote: >> but I think I don't >> like this refactoring much. Will take a closer look tomorrow. > I was afraid you'd say that, especially for a change that should be > backpatched. But I couldn't think of alternative ways to do it

Re: [HACKERS] [PATCH] Fix ScalarArrayOpExpr estimation for GIN indexes

2011-12-20 Thread Marti Raudsepp
On Tue, Dec 20, 2011 at 07:08, Tom Lane wrote: > it'd likely be better if this code ignored unrecognized qual expression > types rather than Assert'ing they're not there. The patch replaced that Assert with an elog(ERROR) > Hmm.  I am reminded of how utterly unreadable "diff -u" format is for >

Re: [HACKERS] [PATCH] Fix ScalarArrayOpExpr estimation for GIN indexes

2011-12-19 Thread Tom Lane
Marti Raudsepp writes: > Since PostgreSQL 9.1, GIN has new cost estimation code. This code > assumes that the only expression type it's going to see is OpExpr. > However, ScalarArrayOpExpr has also been possible in earlier versions. > Estimating col ANY () queries segfaults in 9.1 if there's > a

[HACKERS] [PATCH] Fix ScalarArrayOpExpr estimation for GIN indexes

2011-12-19 Thread Marti Raudsepp
Hi list, Since PostgreSQL 9.1, GIN has new cost estimation code. This code assumes that the only expression type it's going to see is OpExpr. However, ScalarArrayOpExpr has also been possible in earlier versions. Estimating col ANY () queries segfaults in 9.1 if there's a GIN index on the column.