Re: Compare rows, SEMI-SUMMARY

From: Greg Spiegelberg <gspiegelberg(at)cranel(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Compare rows, SEMI-SUMMARY
Date: 2003-10-09 20:14:08
Message-ID: 3F85C190.6080108@cranel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Per Josh's recommendation to implement a Vertical Child Table I came
up with 3 possible tables to handle the 3 possible value types: varchar,
numeric and bigint. Each table has 7 columns: 1 to denote the time the
data was collected, 4 which identify where the data came from, 1 to
tell me the value name and the last being the value itself.

OLD NEW
tables 1 3
columns 642 7 each
indexes ~1200 39
views 37 ?
rows 1700-3000 30,000
query on table 0.01 sec 0.06 sec
query on view 0.02 sec ?

Not too bad. Guess there were a few 0's and NULL's out there, eh?

642 * 1,700 = 1,091,400 cells
3 * 7 * 30,000 = 630,000 cells
461,400 NULL's and 0's using the big 'ol table

I can get around in this setup, however, I would appreciate some help
in recreating my views. The views use to be there simply as an initial
filter and to hide all the 0's and NULL's. If I can't do this I will
be revisiting and testing possibly hundreds of programs and scripts.

Any takers?

Greg

--
Greg Spiegelberg
Sr. Product Development Engineer
Cranel, Incorporated.
Phone: 614.318.4314
Fax: 614.431.8388
Email: gspiegelberg(at)Cranel(dot)com
Cranel. Technology. Integrity. Focus.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message David Griffiths 2003-10-09 20:26:22 Re: OFFTOPIC: PostgreSQL vs MySQL
Previous Message Josh Berkus 2003-10-09 20:01:17 Re: [PERFORM] OFFTOPIC: PostgreSQL vs MySQL