X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7F405D1B4F9 for ; Thu, 9 Oct 2003 20:14:59 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 20325-04 for ; Thu, 9 Oct 2003 17:14:15 -0300 (ADT) Received: from colsweeper.cranel.com (newmail.cranel.com [12.32.71.147]) by svr1.postgresql.org (Postfix) with ESMTP id 91EEBD1B4EA for ; Thu, 9 Oct 2003 17:14:12 -0300 (ADT) Received: from colmail01.cranel.com (colmail01.cranel.com) by colsweeper.cranel.com (Content Technologies SMTPRS 4.2.5) with ESMTP id for ; Thu, 9 Oct 2003 16:16:21 -0400 Received: from cranel.com (gspiegelberg.cranel.com [192.168.11.134]) by colmail01.cranel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id T6NHFQVJ; Thu, 9 Oct 2003 16:17:06 -0400 Message-ID: <3F85C190.6080108@cranel.com> Date: Thu, 09 Oct 2003 16:14:08 -0400 From: Greg Spiegelberg Organization: Cranel, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Compare rows, SEMI-SUMMARY References: <3F841A28.8060504@cranel.com> <200310081611.59179.josh@agliodbs.com> <200310082236.59305.josh@agliodbs.com> <1065719782.2529.7.camel@fuji.krosing.net> In-Reply-To: <1065719782.2529.7.camel@fuji.krosing.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/308 X-Sequence-Number: 4056 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@Cranel.com Cranel. Technology. Integrity. Focus.