pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Page <dpage@pgadmin.org>
To: Dimi Paun <dimi@lattica.com>
Cc: Scott Marlowe <scott.marlowe@gmail.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Bad performance on simple query
Date: Mon, 17 Nov 2008 20:47:48 +0000
Message-ID: <937d27e10811171247m1c8a2bd6l362cdf82f99fbc0f@mail.gmail.com> (raw)
In-Reply-To: <1226945654.5760.106.camel@dimi.lattica.com>
References: <1226937197.5760.89.camel@dimi.lattica.com>
	<dcc563d10811170853y75b1286fy503d82222b49bf15@mail.gmail.com>
	<1226941621.5760.97.camel@dimi.lattica.com>
	<dcc563d10811170916n622e4f86g8f2b2dbe9b9e2a61@mail.gmail.com>
	<1226943062.5760.103.camel@dimi.lattica.com>
	<dcc563d10811170940l3a2673a9o19f253b5b10c4c38@mail.gmail.com>
	<1226945654.5760.106.camel@dimi.lattica.com>

On Mon, Nov 17, 2008 at 6:14 PM, Dimi Paun <dimi@lattica.com> wrote:
>
> On Mon, 2008-11-17 at 10:40 -0700, Scott Marlowe wrote:
>> I'm guessing a fair bit of that time is pgadminIII prettifying the
>> output for you, etc.  I.e. it's not all transfer time.  Hard to say
>> without hooking some kind of profiler in pgadminIII.  Is psql running
>> local and pgadminIII remotely?  Or are they both remote?  If both psql
>> and pgadminIII are remote (i.e. same basic circumstances) then it's
>> got to be a difference in the client causing the extra time.  OR is
>> this output of explain analyze?
>
> With \timing on I get basically the same output (local vs remote)
> in psql (0.668ms vs. 0.760ms). More like it.
>
>
> WTH is pgadminIII reporting?!?

Exactly what it's supposed to be, however it's using libpq's
asynchronous query interface and has to pass the query result  through
the wxWidgets event handling system, both of which seem to add a few
milliseconds to the overall query time from the quick testing I've
just done. In a GUI app like pgAdmin, we need use this kind of
architecture to allow the UI to continue processing events (such as
button clicks, redraws etc), and to allow multiple windows to work
independently without one query locking up the whole app.

Note that the rendering time that Tom mentioned the other day which
used to confuse things has not been an issue for a couple of years -
that was dependent on resultset size and could lead to much bigger
variations. that was fixed by having libpq act as a virtual data store
for the UI instead of transferring data from the PGresult to the data
grid's own data store.

I think the bottom line is that you cannot compare psql and pgAdmin's
timings because the architectures of the two apps are very different.
Further, pgAdmin isn't the best choice for micro-optimisation of
extremely fast queries.

-- 
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com



view thread (10+ messages)

Message-ID: <937d27e10811171247m1c8a2bd6l362cdf82f99fbc0f@mail.gmail.com>
Permalink:  ../937d27e10811171247m1c8a2bd6l362cdf82f99fbc0f@mail.gmail.com/
Also on:    postgresql.org/message-id/937d27e10811171247m1c8a2bd6l362cdf82f99fbc0f@mail.gmail.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: dpage@pgadmin.org, dimi@lattica.com, scott.marlowe@gmail.com
  Subject: Re: Bad performance on simple query
  In-Reply-To: <937d27e10811171247m1c8a2bd6l362cdf82f99fbc0f@mail.gmail.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