Re: psql: what's the SQL to compute the ratio of table sizes?

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Kynn Jones" <kynnjo(at)gmail(dot)com>
Cc: "pgsql-general General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql: what's the SQL to compute the ratio of table sizes?
Date: 2008-10-17 21:17:18
Message-ID: dcc563d10810171417x152ae6a6wfd110145d39ef5c4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 17, 2008 at 1:30 PM, Kynn Jones <kynnjo(at)gmail(dot)com> wrote:
> Suppose I have two table X and Y and I want to compute the ratio of the
> number of rows in X and the number of rows in Y. What would be the SQL I
> could type into a psql session to get this number?
> This is an example of the recurring problem of performing arithmetic using
> the result of various calls to count(*) (or other mathematic functions).

do you need exact or approximate answers for the number of rows?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brian Modra 2008-10-17 21:19:28 ideal server
Previous Message John Skillings 2008-10-17 20:37:52 Re: Copying Blobs between two tables using Insert stmt