pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Kevin Brown <kevin@sysexperts.com>
Cc: Pgsql-Performance (E-mail) <pgsql-performance@postgresql.org>
Subject: Re: How to interpret this explain analyse?
Date: 15 Feb 2005 02:17:49 -0500
Message-ID: <877jla47he.fsf@stark.xeocode.com> (raw)
In-Reply-To: <20050215001011.GA31014@filer>
References: <A3D1526C98B7C1409A687E0943EAC410605F00@obelix.askesis.nl>
	<13008.1108150825@sss.pgh.pa.us>
	<20050215001011.GA31014@filer>


Kevin Brown <kevin@sysexperts.com> writes:

> Ouch.  Is this really a reasonable assumption?  I figured the primary
> use of a cursor was to fetch small amounts of data at a time from a
> large table, so 10% seems extremely high as an average fetch size.  Or
> is the optimization based on the number of rows that will be fetched
> by the cursor during the cursor's lifetime (as opposed to in a single
> fetch)?
> 
> 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.

I would also find it reasonable to have hints to specify a selectivity for
expressions the optimizer has no hope of possibly being able to estimate.
Things like "WHERE myfunction(col1,col2,?) /*+ 10% */"


-- 
greg




view thread (10+ messages)  latest in thread

Message-ID: <877jla47he.fsf@stark.xeocode.com>
Permalink:  ../877jla47he.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/877jla47he.fsf@stark.xeocode.com

 · 

reply

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: gsstark@mit.edu, kevin@sysexperts.com
  Subject: Re: How to interpret this explain analyse?
  In-Reply-To: <877jla47he.fsf@stark.xeocode.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