Re: How to interpret this explain analyse? - Mailing list pgsql-performance

From Kevin Brown
Subject Re: How to interpret this explain analyse?
Date
Msg-id 20050216210928.GB31014@filer
Whole thread Raw
In response to Re: How to interpret this explain analyse?  (Greg Stark <gsstark@mit.edu>)
List pgsql-performance
Greg Stark wrote:
>
> Kevin Brown <kevin@sysexperts.com> writes:
> > Also, one has to ask what the consequences are of assuming a value too
> > low versus too high.  Which ends up being worse?
>
> This is one of the things the planner really cannot know. Ultimately it's the
> kind of thing for which hints really are necessary. Oracle distinguishes
> between the "minimize total time" versus "minimize startup time" with
> /*+ ALL_ROWS */ and /*+ FIRST_ROWS */ hints, for example.

Well, the planner *can* know the actual value to use in this case, or
at least a close approximation, but the system would have to gather
some information about cursors during fetches.  At the very least, it
will know how many rows were actually fetched by the cursor in
question, and it will also hopefully know how many rows were returned
by the query being executed.  Store the ratio of the two in a list,
then store the list itself into a table (or something) at backend exit
time.


--
Kevin Brown                          kevin@sysexperts.com

pgsql-performance by date:

Previous
From: "lcham02"
Date:
Subject: disagreeing query planners
Next
From: Ron Mayer
Date:
Subject: Re: seq scan cache vs. index cache smackdown