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 t...@sss.pgh.pa.us 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:

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

2011-12-20 Thread Tom Lane
Marti Raudsepp ma...@juffo.org writes: On Tue, Dec 20, 2011 at 07:08, Tom Lane t...@sss.pgh.pa.us 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

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 t...@sss.pgh.pa.us 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

[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 op ANY (array) queries segfaults in 9.1 if there's a GIN index on the

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

2011-12-19 Thread Tom Lane
Marti Raudsepp ma...@juffo.org 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 op ANY (array) queries segfaults in