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 83B8CD1C942 for ; Wed, 23 Jul 2003 01:04:30 +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 07707-09 for ; Tue, 22 Jul 2003 22:03:47 -0300 (ADT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 12D3CD1C508 for ; Tue, 22 Jul 2003 22:04:28 -0300 (ADT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.0.6) with ESMTP-TLS id 12073; Tue, 22 Jul 2003 17:29:10 -0700 Message-ID: <3F1DDE9D.4010108@joeconway.com> Date: Tue, 22 Jul 2003 18:02:21 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Castle, Lindsay" Cc: pgsql-performance@postgresql.org Subject: Re: One table or many tables for data set References: In-Reply-To: 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: 200307/381 X-Sequence-Number: 2674 Castle, Lindsay wrote: > I'm working on a project that has a data set of approximately 6million rows > with about 12,000 different elements, each element has 7 columns of data. > > I'm wondering what would be faster from a scanning perspective (SELECT > statements with some calculations) for this type of set up; > one table for all the data > one table for each data element (12,000 tables) > one table per subset of elements (eg all elements that start with > "a" in a table) > I, for one, am having difficulty understanding exactly what your data looks like, so it's hard to give advice. Maybe some concrete examples of what you are calling "rows", "elements", and "columns" would help. Does each of 6 million rows have 12000 elements, each with 7 columns? Or do you mean that out of 6 million rows, there are 12000 distinct kinds of elements? > Can I do anything with Indexing to help with performance? I suspect for the > majority of scans I will need to evaluate an outcome based on 4 or 5 of the > 7 columns of data. > Again, this isn't clear to me -- but maybe I'm just being dense ;-) Does this mean you expect 4 or 5 items in your WHERE clause? Joe