Re: [GENERAL] Quick estimate of num of rows & table size

2012-11-05 Thread Tom Lane
Thalis Kalfigkopoulos writes: > I read somewhere that the following query gives a quick estimate of the # > of rows in a table regardless of the table's size (which would matter in a > simple SELECT count(*)?): > SELECT (CASE WHEN reltuples > 0 THEN > pg_relation_size('mytable')/(8192*relpages/re

Re: [GENERAL] Quick estimate of num of rows & table size

2012-11-05 Thread Thalis Kalfigkopoulos
On Mon, Nov 5, 2012 at 9:04 PM, Lonni J Friedman wrote: > On Mon, Nov 5, 2012 at 3:56 PM, Thalis Kalfigkopoulos > wrote: > > > > On Mon, Nov 5, 2012 at 7:14 PM, Lonni J Friedman > wrote: > >> > >> On Mon, Nov 5, 2012 at 2:02 PM, Thalis Kalfigkopoulos > >> wrote: > >> > Hi all, > >> > > >> > I

Re: [GENERAL] Quick estimate of num of rows & table size

2012-11-05 Thread Lonni J Friedman
On Mon, Nov 5, 2012 at 3:56 PM, Thalis Kalfigkopoulos wrote: > > On Mon, Nov 5, 2012 at 7:14 PM, Lonni J Friedman wrote: >> >> On Mon, Nov 5, 2012 at 2:02 PM, Thalis Kalfigkopoulos >> wrote: >> > Hi all, >> > >> > I read somewhere that the following query gives a quick estimate of the >> > # of

Re: [GENERAL] Quick estimate of num of rows & table size

2012-11-05 Thread Thalis Kalfigkopoulos
On Mon, Nov 5, 2012 at 7:14 PM, Lonni J Friedman wrote: > On Mon, Nov 5, 2012 at 2:02 PM, Thalis Kalfigkopoulos > wrote: > > Hi all, > > > > I read somewhere that the following query gives a quick estimate of the > # of > > rows in a table regardless of the table's size (which would matter in a

Re: [GENERAL] Quick estimate of num of rows & table size

2012-11-05 Thread Lonni J Friedman
On Mon, Nov 5, 2012 at 2:02 PM, Thalis Kalfigkopoulos wrote: > Hi all, > > I read somewhere that the following query gives a quick estimate of the # of > rows in a table regardless of the table's size (which would matter in a > simple SELECT count(*)?): > > SELECT (CASE WHEN reltuples > 0 THEN > p