Re: generate_series woes - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: generate_series woes
Date
Msg-id 20080416122016.GA28221@depesz.com
Whole thread Raw
In response to generate_series woes  (Harald Fuchs <hari.fuchs@googlemail.com>)
Responses Re: generate_series woes  (Volkan YAZICI <yazicivo@ttmail.com>)
List pgsql-general
On Mon, Apr 14, 2008 at 11:21:58AM +0200, Harald Fuchs wrote:
> I think there's something sub-optimal with generate_series.
> In the following, "documents" is a table with more than 120000 rows,
> vacuumed and analyzed before the queries.
> Since generate_series is a builtin function, can't it tell how many
> rows it will return?

i think it would be better off not to limit some functionality for
builtin functions. it would be much nicer to have the ability to hint
planer about rowcount from function *in* the sql.

something like:

select i from generate_series(1,10) {hint:10} as i;

i'm not proposiung syntax. i'm suggesting the functionality.

depesz

--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA.  here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)

pgsql-general by date:

Previous
From: Harald Fuchs
Date:
Subject: Re: generate_series woes
Next
From: Volkan YAZICI
Date:
Subject: Re: generate_series woes