Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wa5oS-0007T4-Fb for pgsql-general@arkaria.postgresql.org; Tue, 15 Apr 2014 16:02:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wa5oR-0001F2-QJ for pgsql-general@arkaria.postgresql.org; Tue, 15 Apr 2014 16:02:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wa5oQ-0001Eu-Ql for pgsql-general@postgresql.org; Tue, 15 Apr 2014 16:02:18 +0000 Received: from mail-ig0-x22d.google.com ([2607:f8b0:4001:c05::22d]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wa5oK-0005FL-5e for pgsql-general@postgresql.org; Tue, 15 Apr 2014 16:02:18 +0000 Received: by mail-ig0-f173.google.com with SMTP id hl10so4571886igb.0 for ; Tue, 15 Apr 2014 09:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=fQKK1XSHLu4oicS9kQvrExmsYDLmwciGSLcPa7o8EN8=; b=00wIx3kEN2kXQ/PUsgj++q7/rGppO8CeimOVDsO5JS5flrXINtf7oWQnYMf5HkDBvQ Mc3nzF51t2KceqHFnZPx0Cl32nHuXp3AVhJgdLhYgkal9mHS07enxiG4+Th3MC8gr/sa ifpPQM8MzcIsyLWQA+VavQmnMSgYIi2M9pB2AN+l/sOeiOCXSi6kcl7Cw2bObwx4e44D OAknPD0s29FNVe9XMVywnHX+7KT3Jc6eSTS/ZfR3g2Mo+CS4e+0BMl5P+1UPLFzUcfJ0 GexBAYs6mr8XtUu2GpLB4sd+6nmY2RJsCF/eTCEO5FwSr3U1ZP23XAeF7mB5b8y0F1hw Xo6Q== X-Received: by 10.50.102.33 with SMTP id fl1mr24386684igb.22.1397577730475; Tue, 15 Apr 2014 09:02:10 -0700 (PDT) Received: from stability.med.utah.edu (stability.med.utah.edu. [155.100.158.97]) by mx.google.com with ESMTPSA id b8sm38725845igx.3.2014.04.15.09.02.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 09:02:09 -0700 (PDT) Message-ID: <534D5800.1060400@gmail.com> Date: Tue, 15 Apr 2014 10:02:08 -0600 From: Rob Sargent User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: Approach to Data Summary and Analysis References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 04/15/2014 09:53 AM, Robert DiFalco wrote: > Actually that was exactly the initial table design. There were more > fields because for my use case there were a lot more states and > certain states have additional data (for example when a call goes from > answered to connected it also gets the user_id of the person being > connected to). So that one table started getting a LOT of columns > which starting making it hard to reason about. > > The more normalized version has a couple of things going for it. > COUNT, MIN, MAX, etc are very fast because I don't have to > conditionally add null checks. Everything is inserted so for the > millions of calls that get made the normalized schema was much more > efficient for writing. It was also easier to understand. The answer > table only has calls that were answered, the error table only has > calls the resulted in an error after being connected, etc. > > I know this kind of gets into a religious area when discussing NULLs > and what level of normalization is appropriate so I don't want to > spark any of that on this thread. But only doing inserts and never > doing updates or deletes performed very well for large data sets. > > That said, I could explore a compromise between the monolithic table > approach and the completely normalized set of tables approach. Thanks > for your input! > I wonder if the "LOT of columns" are the bits that need to be parcelled off as specific to one condition of a call? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general