Re: [HACKERS] Re: order by and index path - Mailing list pgsql-hackers

From jwieck@debis.com (Jan Wieck)
Subject Re: [HACKERS] Re: order by and index path
Date
Msg-id m0zTqO2-000EBRC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to Re: [HACKERS] Re: order by and index path  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
>
> >     could return at max 8999 tuples and
> >
> >         WHERE key > 50 AND key < 70
> >
> >     has  a  maximum  of  998  result  tuples.  This  would be the
> >     information required to make the right decision for the  case
> >     where all rows selected are wanted.
> >
> >     We  do  not  have  this statistical information. So the whole
> >     thing is at this time academic.
>
> But we do have statistical information in pg_statistic if you run vacuum
> analyze.

    Nice  (forgot  that  - pardon), anyway only having lowest and
    highest key values isn't enough to make a  useful  estimation
    about  how  many  rows an indexqual will return. If we change
    pg_statistic in a way that  more  keys  can  get  stored  per
    relation/attribute,  then  the  optimizer  would  have a real
    chance on it.

    I have

        starelid
        staattnum
        staitupno
        staop
        stakey

    in mind, where staitupno tells the position of the key  in  a
    complete index scan. Then it becomes the place to fill in the
    key range information as described in my posting.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

pgsql-hackers by date:

Previous
From: darcy@druid.net (D'Arcy J.M. Cain)
Date:
Subject: Re: [HACKERS] PostgreSQL v6.4 BETA2...
Next
From: Martin
Date:
Subject: Re: [HACKERS] Re: order by and index path