Re: Any better plan for this query?..

From: Kevin Grittner
Subject: Re: Any better plan for this query?..
Date: ,
Msg-id: 4A0A93A7.EE98.0025.0@wicourts.gov
(view: Whole thread, Raw)
In response to: Re: Any better plan for this query?..  (Glenn Maynard)
Responses: Re: Any better plan for this query?..  (Dimitri)
List: pgsql-performance

Tree view

Any better plan for this query?..  (Dimitri, )
 Re: Any better plan for this query?..  (Craig Ringer, )
  Re: Any better plan for this query?..  (Dimitri, )
   Re: Any better plan for this query?..  (Chris, )
    Re: Any better plan for this query?..  (Dimitri, )
     Re: Any better plan for this query?..  (Richard Huxton, )
     Re: Any better plan for this query?..  (Craig Ringer, )
      Re: Any better plan for this query?..  (Kenneth Marshall, )
       Re: Any better plan for this query?..  (Matthew Wakeling, )
      Re: Any better plan for this query?..  (Dimitri, )
  Re: Any better plan for this query?..  (Kenneth Marshall, )
 Re: Any better plan for this query?..  (Heikki Linnakangas, )
  Re: Any better plan for this query?..  (Dimitri, )
   Re: Any better plan for this query?..  (Simon Riggs, )
    Re: Any better plan for this query?..  (Dimitri, )
     Re: Any better plan for this query?..  (Merlin Moncure, )
      Re: Any better plan for this query?..  (Dimitri, )
       Re: Any better plan for this query?..  (Simon Riggs, )
        Re: Any better plan for this query?..  (Dimitri, )
         Re: Any better plan for this query?..  (Tom Lane, )
          Re: Any better plan for this query?..  (Dimitri, )
          Re: Any better plan for this query?..  (Simon Riggs, )
         Re: Any better plan for this query?..  (Merlin Moncure, )
         Re: Any better plan for this query?..  (Simon Riggs, )
          Re: Any better plan for this query?..  (Dimitri, )
         Re: Any better plan for this query?..  (Aidan Van Dyk, )
          Re: Any better plan for this query?..  (Dimitri, )
           Re: Any better plan for this query?..  (Alvaro Herrera, )
            Re: Any better plan for this query?..  (Dimitri, )
             Re: Any better plan for this query?..  (Dimitri Fontaine, )
              Re: Any better plan for this query?..  (Dimitri, )
               Re: Any better plan for this query?..  (Simon Riggs, )
                Re: Any better plan for this query?..  (Dimitri, )
                 Re: Any better plan for this query?..  (Simon Riggs, )
               Re: Any better plan for this query?..  (Heikki Linnakangas, )
                Re: Any better plan for this query?..  (Dimitri, )
                 Re: Any better plan for this query?..  (Simon Riggs, )
                  Re: Any better plan for this query?..  (Dimitri, )
                   Re: Any better plan for this query?..  (Simon Riggs, )
                    Re: Any better plan for this query?..  (Dimitri, )
                     Re: Any better plan for this query?..  (Simon Riggs, )
                      Re: Any better plan for this query?..  ("Dave Dutcher", )
                       Re: Any better plan for this query?..  (Dimitri, )
                        Re: Any better plan for this query?..  (Merlin Moncure, )
                         Re: Any better plan for this query?..  (Dimitri, )
                          Re: Any better plan for this query?..  (Merlin Moncure, )
                           Re: Any better plan for this query?..  (Dimitri, )
                            Re: Any better plan for this query?..  (Merlin Moncure, )
                      Re: Any better plan for this query?..  (Dimitri, )
                       Re: Any better plan for this query?..  (Simon Riggs, )
                        Re: Any better plan for this query?..  (Dimitri, )
                         Re: Any better plan for this query?..  (Dimitri, )
                          Re: Any better plan for this query?..  (Simon Riggs, )
                           Re: Any better plan for this query?..  (Dimitri, )
                      Re: Any better plan for this query?..  (Tom Lane, )
                       Re: Any better plan for this query?..  (Dimitri, )
                       Re: Any better plan for this query?..  (Simon Riggs, )
                        Re: Any better plan for this query?..  (Matthew Wakeling, )
                         Re: Any better plan for this query?..  (Simon Riggs, )
                          Re: Any better plan for this query?..  (Simon Riggs, )
                          Re: Any better plan for this query?..  (Matthew Wakeling, )
                           Re: Any better plan for this query?..  (Simon Riggs, )
                           Re: Any better plan for this query?..  (Scott Carey, )
                          Re: Any better plan for this query?..  (Robert Haas, )
                        Re: Any better plan for this query?..  (Tom Lane, )
                         Re: Any better plan for this query?..  (Simon Riggs, )
                          Re: Any better plan for this query?..  (Tom Lane, )
                           Re: Any better plan for this query?..  (Robert Haas, )
                            Re: Any better plan for this query?..  (Simon Riggs, )
                             Re: Any better plan for this query?..  (Robert Haas, )
                              Re: Any better plan for this query?..  (Simon Riggs, )
                     Re: Any better plan for this query?..  (Scott Carey, )
                      Re: Any better plan for this query?..  (Dimitri, )
                       Re: Any better plan for this query?..  (Scott Carey, )
                        Re: Any better plan for this query?..  (Dimitri, )
                         Re: Any better plan for this query?..  (Scott Carey, )
                          Re: Any better plan for this query?..  (Dimitri, )
               Re: Any better plan for this query?..  (Simon Riggs, )
                Re: Any better plan for this query?..  (Dimitri, )
                 Re: Any better plan for this query?..  (Robert Haas, )
                  Re: Any better plan for this query?..  (Dimitri, )
                   Re: Any better plan for this query?..  ("Kevin Grittner", )
                   Re: Any better plan for this query?..  ("Joshua D. Drake", )
                    Re: Any better plan for this query?..  (Dimitri, )
                   Re: Any better plan for this query?..  (Robert Haas, )
                    Re: Any better plan for this query?..  (Dimitri, )
               Re: Any better plan for this query?..  (Stefan Kaltenbrunner, )
                Re: Any better plan for this query?..  (Dimitri, )
                 Re: Any better plan for this query?..  (Stefan Kaltenbrunner, )
                  Re: Any better plan for this query?..  (Matthew Wakeling, )
                   Re: Any better plan for this query?..  (Simon Riggs, )
                    Re: Any better plan for this query?..  (Matthew Wakeling, )
                     Re: Any better plan for this query?..  (Stefan Kaltenbrunner, )
                     Re: Any better plan for this query?..  (Tom Lane, )
                      Re: Any better plan for this query?..  (Robert Haas, )
                  Re: Any better plan for this query?..  (Dimitri, )
   Re: Any better plan for this query?..  ("Joshua D. Drake", )
           Re: Any better plan for this query?..  (Heikki Linnakangas, )
            Re: Any better plan for this query?..  (Dimitri, )
           Re: Any better plan for this query?..  (Andres Freund, )
            Re: Any better plan for this query?..  (Alvaro Herrera, )
             Re: Any better plan for this query?..  (Scott Carey, )
              Re: Any better plan for this query?..  (Dimitri, )
               Re: Any better plan for this query?..  (Scott Carey, )
                Re: Any better plan for this query?..  (Dimitri Fontaine, )
                 Re: Any better plan for this query?..  (Dimitri, )
                 Re: Any better plan for this query?..  (Simon Riggs, )
                Re: Any better plan for this query?..  (Dimitri, )
    Re: Any better plan for this query?..  (Gregory Stark, )
     Re: Any better plan for this query?..  (Simon Riggs, )
  Re: Any better plan for this query?..  (Matthew Wakeling, )
  Re: Any better plan for this query?..  (Tom Lane, )
   Re: Any better plan for this query?..  (Greg Stark, )
   Re: Any better plan for this query?..  (Robert Haas, )
  Re: Any better plan for this query?..  (Simon Riggs, )
   Re: Any better plan for this query?..  ("Joshua D. Drake", )
    Re: Any better plan for this query?..  (Aidan Van Dyk, )
     Re: Any better plan for this query?..  (Stephen Frost, )
   Re: Any better plan for this query?..  (Robert Haas, )
   Re: Any better plan for this query?..  (Glenn Maynard, )
    Re: Any better plan for this query?..  (Dimitri, )
    Re: Any better plan for this query?..  ("Kevin Grittner", )
     Re: Any better plan for this query?..  (Dimitri, )
      Re: Any better plan for this query?..  ("Kevin Grittner", )
  Re: Any better plan for this query?..  (Dimitri Fontaine, )
   Re: Any better plan for this query?..  (Alvaro Herrera, )
  Re: Any better plan for this query?..  (Robert Haas, )
   Re: Any better plan for this query?..  (Dimitri, )
 Re: Any better plan for this query?..  (Dimitri, )
  Re: Any better plan for this query?..  (Richard Huxton, )
  Re: Any better plan for this query?..  ("Albe Laurenz", )
   Re: Any better plan for this query?..  (Dimitri, )
    Re: Any better plan for this query?..  (Kenneth Marshall, )
 Re: Any better plan for this query?..  (Merlin Moncure, )
  Re: Any better plan for this query?..  (Merlin Moncure, )
   Re: Any better plan for this query?..  (Dimitri, )
    Re: Any better plan for this query?..  (Richard Huxton, )
     Re: Any better plan for this query?..  (Ries van Twisk, )
      Re: Any better plan for this query?..  (Dimitri, )
 Re: Any better plan for this query?..  (Kenneth Marshall, )
  Re: Any better plan for this query?..  (Dimitri, )
   Re: Any better plan for this query?..  (Kenneth Marshall, )
 Re: Any better plan for this query?..  (Dimitri, )
  Re: Any better plan for this query?..  (Alvaro Herrera, )
 Re: Any better plan for this query?..  (Simon Riggs, )

Glenn Maynard <> wrote:
> I'm sorry, but I'm confused.  Everyone keeps talking about
> connection pooling, but Dimitri has said repeatedly that each client
> makes a single connection and then keeps it open until the end of
> the test, not that it makes a single connection per SQL query.
> Connection startup costs shouldn't be an issue.  Am I missing
> something here?

Quite aside from the overhead of spawning new processes, if you have
more active connections than you have resources for them to go after,
you just increase context switching and resource contention, both of
which have some cost, without any offsetting gains.  That would tend
to explain why performance tapers off after a certain point.  A
connection pool which queues requests prevents this degradation.

It would be interesting, with each of the CPU counts, to profile
PostgreSQL at the peak of each curve to see where the time goes when
it is operating with an optimal poolsize.  Tapering after that point
is rather uninteresting, and profiles would be less useful beyond that
point, as the noise from the context switching and resource contention
would make it harder to spot issues that really matter..

-Kevin


pgsql-performance by date:

From: Thomas Finneid
Date:
Subject: Re: increase index performance
From: Dimitri Fontaine
Date:
Subject: Re: Any better plan for this query?..