pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <kgrittn@mail.com>
Cc: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: Amitabh Kant <amitabhkant@gmail.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Limit & offset effect on query plans
Date: Thu, 13 Dec 2012 12:12:50 -0500
Message-ID: <7063.1355418770@sss.pgh.pa.us> (raw)
In-Reply-To: <20121213170700.80080@gmx.com>
References: <20121213170700.80080@gmx.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

"Kevin Grittner" <kgrittn@mail.com> writes:
> Tom Lane wrote:
>> 1.35ms out of what?

> Without the limit node the runtimes (after "priming" the cache)
> were:

> 1.805, 2.533
> 1.805, 2.495
> 1.800, 2.446
> 1.818, 2.470
> 1.804, 2.502

> The first time for each run is "Total runtime" reported by EXPLAIN,
> the second is what psql reported from having \timing on.

> With the limit node:

> 3.237, 3.914
> 3.243, 3.918
> 3.263, 4.010
> 3.265, 3.943
> 3.272, 3.953

> I eyeballed that in the console window and said 1.35 based on rough
> in-my-head calculations, although with it laid out in a nicer
> format, I think I was a little low.

Huh, so on a percentage basis the Limit-node overhead is actually pretty
significant, at least for a trivial seqscan plan like this case.
(This is probably about the worst-case scenario, really, since it's
tough to beat a simple seqscan for cost-per-emitted-row.  Also I gather
you're not actually transmitting any data to the client ...)

			regards, tom lane


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (7+ messages)  latest in thread

Message-ID: <7063.1355418770@sss.pgh.pa.us>
Permalink:  ../7063.1355418770@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7063.1355418770@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, kgrittn@mail.com, pavan.deolasee@gmail.com, amitabhkant@gmail.com
  Subject: Re: Limit & offset effect on query plans
  In-Reply-To: <7063.1355418770@sss.pgh.pa.us>

* 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