Re: Patch for adding DATACUBE operator

From: sumit <sumit(at)gdit(dot)iiit(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Patch for adding DATACUBE operator
Date: 2003-06-30 11:42:54
Message-ID: Pine.LNX.4.44.0306301652150.4223-100000@students.iiit.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Well, it is true that the information for the ALL rows is present
in the base query. But then adding the ALL rows directly after examining
the result, we think, is not as efficient as it sounds.

Consider the situation you are talking about. Suppose we decide to
add the ALL rows directly to the base result. A major drawback would be
that we would have to execute the whole WHERE clause and/or joins over the
original relations, which, in case of large databases, would cause a lot of
overhead. Whereas, executing the UNION of SELECT queries on the base table
obtained from the base query (WITHOUT CUBE) does not have to handle these
situations (WHERE clause, JOIN cases). More importantly, this is faster
(due to the relatively smaller size).

It is true that a summary table is much smaller than the base
table. But a DATACUBE (as per definition) takes into account even the base
query (the one WITHOUT CUBE). We have referred some sites and articles
before planning the code. Since we are building a DATACUBE all the
information is required.

Hope we have made ourselves clear.

Sumit
Srikanth

On Mon, 30 Jun 2003, Andrew Dunstan wrote:

>
> I'm curious to know why you implement this as a union of queries, since,
> unless my understanding is badly awry, you have all the information
> necessary for the ALL rows by running the base (ie. without cube) query, Why
> not just run that query and then add the ALL rows from examining the
> results? ISTM that would be more efficient, since the summary table is in
> most real world situations likely to be far, far smaller than the base
> table.
>
> andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message deststar 2003-06-30 12:16:25 Is Patch Ok for deferred trigger disk queue?
Previous Message Andrew Dunstan 2003-06-30 11:09:54 Re: Patch for adding DATACUBE operator

Browse pgsql-patches by date

  From Date Subject
Next Message Jean-Michel POURE 2003-06-30 13:48:01 Re: Translation request of pgAdmin3 into Czech
Previous Message Dennis Björklund 2003-06-30 11:32:29 svedish trans