Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 764EE632DE5 for ; Wed, 10 Feb 2010 21:42:30 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 87658-09 for ; Thu, 11 Feb 2010 01:42:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mail.postgresql.org (Postfix) with ESMTP id 90C46632CF3 for ; Wed, 10 Feb 2010 21:42:19 -0400 (AST) Received: from [192.168.0.105] (pool-96-244-14-10.bltmmd.fios.verizon.net [96.244.14.10]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0M1CHs-1NzGP91fTc-00tZQV; Thu, 11 Feb 2010 02:42:17 +0100 Message-ID: <4B736075.1080704@2ndquadrant.com> Date: Wed, 10 Feb 2010 20:42:13 -0500 From: Greg Smith User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: rama CC: pgsql-performance@postgresql.org Subject: Re: perf problem with huge table References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX1/y+ICelGgIwkXeqrbLe3emzW2GY+qHLr/fz48 UPBgvWtKo1bm2CorU3cYN/yCIjtzIaKNX6xRNbbjONvj12TbV+ GuHjelN9u/YVns9Dr2Z4bJPeD+CgIt/ X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.419 tagged_above=-10 required=5 tests=AWL=0.180, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/173 X-Sequence-Number: 37594 rama wrote: > in that way, when i need to do a query for a long ranges (ie: 1 year) i just take the rows that are contained to contab_y > if i need to got a query for a couple of days, i can go on ymd, if i need to get some data for the other timeframe, i can do some cool intersection between > the different table using some huge (but fast) queries. > > Now, the matter is that this design is hard to mantain, and the tables are difficult to check > You sound like you're trying to implement something like materialized views one at a time; have you considered adopting the more general techniques used to maintain those so that you're not doing custom development each time for the design? http://tech.jonathangardner.net/wiki/PostgreSQL/Materialized_Views http://www.pgcon.org/2008/schedule/events/69.en.html I think that sort of approach is more practical than it would have been for you in MySQL, so maybe this wasn't on your list of possibilities before. -- Greg Smith 2ndQuadrant Baltimore, MD PostgreSQL Training, Services and Support greg@2ndQuadrant.com www.2ndQuadrant.com