Re: Any better plan for this query?.. - Mailing list pgsql-performance

From Matthew Wakeling
Subject Re: Any better plan for this query?..
Date
Msg-id alpine.DEB.2.00.0905121553370.2341@aragorn.flymine.org
Whole thread Raw
In response to Re: Any better plan for this query?..  (Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>)
Responses Re: Any better plan for this query?..  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-performance
On Tue, 12 May 2009, Stefan Kaltenbrunner wrote:
> But what I get from your answer is that you are basically doing one
> connect/disconnect per client and the testcase you are talking about has 256
> clients?

Correct me if I'm wrong, but won't connect operations be all handled by a
single thread - the parent postmaster? There's your scalability problem
right there. Also, spawning a new backend process is an awful lot of
overhead to run just one query.

As far as I can see, it's quite understandable for MySQL to perform better
than PostgreSQL in these circumstances, as it has a smaller simpler
backend to start up each time. If you really want to get a decent
performance out of Postgres, then use long-lived connections (which most
real-world use cases will do) and prepare your queries in advance with
parameters.

Matthew

--
 import oz.wizards.Magic;
   if (Magic.guessRight())...           -- Computer Science Lecturer

pgsql-performance by date:

Previous
From: Robert Haas
Date:
Subject: Re: Any better plan for this query?..
Next
From: Simon Riggs
Date:
Subject: Re: Any better plan for this query?..