X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7911D52B30 for ; Thu, 14 Jul 2005 12:27:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 14260-10 for ; Thu, 14 Jul 2005 15:26:56 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.194]) by svr1.postgresql.org (Postfix) with ESMTP id 4212852A1A for ; Thu, 14 Jul 2005 12:26:52 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 58so430836wri for ; Thu, 14 Jul 2005 08:26:52 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QcJjvgPkky50uUq/jfCcFCP5k76LOlN6sIy298vK/h0wetaO7bB1yigazOTJwtzQ6HtxaxF89lxBRGvOzczVlgC34+xhgA7PtvXYCQ9X6IE6RILrXhTvNbUSD4DCpmpqsSktprELZwTQJibcB2yzOeyiiEvfMVpwxUzbujGtrFo= Received: by 10.54.28.42 with SMTP id b42mr766409wrb; Thu, 14 Jul 2005 08:26:09 -0700 (PDT) Received: by 10.54.94.16 with HTTP; Thu, 14 Jul 2005 08:26:09 -0700 (PDT) Message-ID: <28b4448e0507140826617e9c2a@mail.gmail.com> Date: Thu, 14 Jul 2005 17:26:09 +0200 From: Frank Hagstrom Reply-To: Frank Hagstrom To: Richard Huxton Subject: Re: Possible to use a table to tell what table to select from? Cc: pgsql-sql@postgresql.org In-Reply-To: <42D622C5.9000907@archonet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <28b4448e05070813326d98e574@mail.gmail.com> <42D622C5.9000907@archonet.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.328 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200507/132 X-Sequence-Number: 22110 On 7/14/05, Richard Huxton wrote: > Frank Hagstrom wrote: > > Hello > > > > I've been thinking on a potential problem I might get in a distant > > future, but once I started thinking on it I just as well had to > > check... > > > > Is it possible to have say ~ 6 tables, where the first one is a > > 'reference' to all the others (they all are with the same structure). > > The other 5 or so have information stored in importance/access/age, > > where one table will be only recent/important things, the other with a > > bit lower priority and so on until the last table that can be really > > huge and slow and used more like a storage ... Is it possible to write > > an SQL query to let the first table figure out what table one will do > > the actual select from? >=20 > If the tables are all holding the same sort of thing, e.g. logs2003, > logs2004, logs2005 etc. then you might want to look at partitioning. > This is being looked at for the next version, check the archives of the > hackers list. >=20 > -- > Richard Huxton > Archonet Ltd >=20 Ah ok, thanks I'll look into the partitioning then :) (not really logs, but will work in the same way, as I'm planning to use it to hold revisions, but it will have the same format in the tables...) /Frank H