Re: [HACKERS] How to read query plan

From: Tom Lane
Subject: Re: [HACKERS] How to read query plan
Date: ,
Msg-id: 4850.1110776411@sss.pgh.pa.us
(view: Whole thread, Raw)
In response to: Re: How to read query plan  (Tom Lane)
Responses: Re: [HACKERS] How to read query plan  (Miroslav Šulc)
List: pgsql-performance

Tree view

How to read query plan  (Miroslav Šulc, )
 Re: How to read query plan  (John Arbash Meinel, )
  Re: How to read query plan  (Miroslav Šulc, )
   Re: How to read query plan  (John Arbash Meinel, )
    Re: How to read query plan  (Miroslav Šulc, )
    Re: How to read query plan  (Tom Lane, )
     Re: How to read query plan  (Miroslav Šulc, )
      Re: How to read query plan  (Tom Lane, )
       Re: How to read query plan  (Miroslav Šulc, )
        Re: How to read query plan  (Tom Lane, )
   Re: How to read query plan  (John Arbash Meinel, )
    Re: How to read query plan  (Miroslav Šulc, )
     Re: How to read query plan  (John Arbash Meinel, )
      Re: How to read query plan  (Miroslav Šulc, )
      Re: How to read query plan  (Miroslav Šulc, )
       Re: How to read query plan  (Christopher Kings-Lynne, )
        Re: How to read query plan  (Miroslav Šulc, )
         Re: How to read query plan  (Greg Stark, )
       Re: How to read query plan  (PFC, )
        Re: How to read query plan  (Miroslav Šulc, )
         Re: How to read query plan  (Tom Lane, )
          Re: How to read query plan  (Miroslav Šulc, )
           Re: How to read query plan  (Kaloyan Iliev Iliev, )
            Re: How to read query plan  (Miroslav Šulc, )
         Re: How to read query plan  (John Arbash Meinel, )
 Re: How to read query plan  (Ragnar Hafstað, )
  Re: How to read query plan  (Miroslav Šulc, )
 Re: How to read query plan  (Tom Lane, )
  Re: [HACKERS] How to read query plan  (Tom Lane, )
   Re: [HACKERS] How to read query plan  (Miroslav Šulc, )
    Re: [HACKERS] How to read query plan  (Tom Lane, )
  Re: How to read query plan  (Miroslav Šulc, )
   Re: How to read query plan  (Tom Lane, )
    Re: How to read query plan  (Miroslav Šulc, )
   Re: How to read query plan  (John Arbash Meinel, )
 Re: How to read query plan  (Harald Fuchs, )
  Re: How to read query plan  (Miroslav Šulc, )
 Avoiding tuple construction/deconstruction during joining  (Tom Lane, )
  Re: Avoiding tuple construction/deconstruction during joining  (Miroslav Šulc, )
   Re: Avoiding tuple construction/deconstruction during joining  (Tom Lane, )
    Re: Avoiding tuple construction/deconstruction during joining  (Miroslav Šulc, )
  Re: Avoiding tuple construction/deconstruction during joining  (PFC, )
  Re: Avoiding tuple construction/deconstruction during joining  (PFC, )

I wrote:
> Since ExecProject operations within a nest of joins are going to be
> dealing entirely with Vars, I wonder if we couldn't speed matters up
> by having a short-circuit case for a projection that is only Vars.
> Essentially it would be a lot like execJunk.c, except able to cope
> with two input tuples.  Using heap_deformtuple instead of retail
> extraction of fields would eliminate the O(N^2) penalty for wide tuples.

Actually, we already had a pending patch (from Atsushi Ogawa) that
eliminates that particular O(N^2) behavior in another way.  After
applying it, I get about a factor-of-4 reduction in the runtime for
Miroslav's example.

ExecEvalVar and associated routines are still a pretty good fraction of
the runtime, so it might still be worth doing something like the above,
but it'd probably be just a marginal win instead of a big win.

            regards, tom lane


pgsql-performance by date:

From: Richard Huxton
Date:
Subject: Re: Performance tuning
From: Stephan Szabo
Date:
Subject: Re: adding 'limit' leads to very slow query