From: Markus Schaber <schabi@logix-tt.com>
To: PFC <lists@peufeu.com>
Cc: pgsql-performance@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Big IN() clauses etc : feature proposal
Date: Wed, 10 May 2006 17:04:25 +0200
Message-ID: <446200F9.3070109@logix-tt.com> (raw)
In-Reply-To: <op.s9cayhotcigqcu@apollo13>
References: <445F7FF8.6070707@comcast.net>
<1147110142.32369.7.camel@archimedes>
<20060508175013.GY99570@pervasive.com>
<28288.1147111196@sss.pgh.pa.us>
<op.s89zl30wcigqcu@apollo13>
<20060509105214.P90693@vesihiisi.cksoft.de>
<op.s8916gm6cigqcu@apollo13>
<758d5e7f0605090943p1bbfdae2p4cb28ba128288316@mail.gmail.com>
<op.s9amckxhcigqcu@apollo13>
<4461EAAC.7030105@logix-tt.com>
<op.s9cayhotcigqcu@apollo13>
Hi, PFC,
PFC wrote:
> You need to do some processing to know how many rows the function
> would return.
> Often, this processing will be repeated in the function itself.
> Sometimes it's very simple (ie. the function will RETURN NEXT each
> element in an array, you know the array length...)
> Sometimes, for functions returning few rows, it might be faster to
> compute the entire result set in the cost estimator.
I know, but we only have to estmiate the number of rows to give a hint
to the query planner, so we can use lots of simplifications.
E. G. for generate_series we return ($2-$1)/$3, and for some functions
even constant estimates will be good enough.
> - please execute me and store my results in a temporary storage,
> count the rows returned, and plan the outer query accordingly
That's an interesting idea.
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: schabi@logix-tt.com, lists@peufeu.com, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Big IN() clauses etc : feature proposal
In-Reply-To: <446200F9.3070109@logix-tt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox