Re: [HACKERS] Big IN() clauses etc : feature proposal

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: PFC <lists(at)peufeu(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Big IN() clauses etc : feature proposal
Date: 2006-05-10 15:04:25
Message-ID: 446200F9.3070109@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nis Jorgensen 2006-05-10 15:30:07 Re: [HACKERS] Big IN() clauses etc : feature proposal
Previous Message Martijn van Oosterhout 2006-05-10 14:55:51 Re: [HACKERS] Big IN() clauses etc : feature proposal

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2006-05-10 15:10:00 Re: [PERFORM] Arguments Pro/Contra Software Raid
Previous Message Nis Jorgensen 2006-05-10 15:02:27 Re: Question about explain-command...