Re: Query Progress Estimator

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Anuj Tripathi <anujt(at)it(dot)iitb(dot)ac(dot)in>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Query Progress Estimator
Date: 2005-10-24 08:03:29
Message-ID: 1130141009.8300.1045.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 2005-10-23 at 02:04 +0530, Anuj Tripathi wrote:
> Hi
> I am trying to implement Query Progress estimator in postgres for
> queries with long run time.I am looking for info regarding the number of
> tuples already processsed by a running query .
> I would be very thankful if someone can suggest where can i find it or
> the data structure that holds the value.
> Right now I am exploring postgres using ddd ( debugger ).Can
> anyone suggest a better utility /editor/tool for exploring the same in a
> better way ?

You should read up on how the Executor works before using ddd. You need
to see the bigger picture first. In some plans, nodes are completely
executed before the next higher node begins the main phase of its
execution - in other cases all nodes are active simultaneously.

While it is executing, an executor node is the only place that knows how
far through its own task it is. That in itself is not much guide to how
the whole query is doing since you need to accumulate these individual
viewpoints.

In my understanding there isn't a supervisor, each node recursively
calls the nodes that need to supply it with data. You'd need some kind
of concept such as that to allow feedback from individual nodes to be
reconciled into a total picture for the query.

Incidentally, this is related to the question: "How much memory is my
query currently using?" (as opposed to "How much memory is currently
allocated?", which is of course externally measurable).

Best Regards, Simon Riggs

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sebastián Ávila 2005-10-24 10:11:55 Semantic optimization is posible?
Previous Message Magnus Hagander 2005-10-24 07:47:22 Re: [PATCHES] Win32 CHECK_FOR_INTERRUPTS() performance