Re: Performance regression: 9.2+ vs. ScalarArrayOpExpr vs. ORDER BY

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, philip(dot)poten(at)gmail(dot)com
Subject: Re: Performance regression: 9.2+ vs. ScalarArrayOpExpr vs. ORDER BY
Date: 2014-07-06 19:56:00
Message-ID: 87ha2u9u5m.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

>> I've experimented with the attached patch, which detects when this
>> situation might have occurred and does another pass to try and
>> build ordered scans without the SAOP condition. However, the
>> results may not be quite ideal, because at least in some test
>> queries (not all) the scan with the SAOP included in the
>> indexquals is being costed higher than the same scan with the SAOP
>> moved to a Filter, which seems unreasonable.

Tom> I'm not convinced that that's a-priori unreasonable, since the
Tom> SAOP will result in multiple index scans under the hood.
Tom> Conceivably we ought to try the path with and with SAOPs all the
Tom> time.

OK, here's a patch that always retries on lower SAOP clauses, assuming
that a SAOP in the first column is always applicable - or is even that
assumption too strong?

--
Andrew (irc:RhodiumToad)

Attachment Content-Type Size
saop2.patch text/x-patch 5.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-07-06 20:58:33 Re: Should extension--unpackaged-$ver.sql's \echo use FROM unpackaged; ?
Previous Message Rajmohan C 2014-07-06 19:15:15 Estimating selectivity of predicates involving string pattern matching