pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedPossible to use a table to tell what table to select from?
3+ messages / 2 participants
[nested] [flat]
* Possible to use a table to tell what table to select from?
@ 2005-07-08 20:32 Frank Hagstrom <frank.hagstrom@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Frank Hagstrom @ 2005-07-08 20:32 UTC (permalink / raw)
To: pgsql-sql
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?
like the pseudo code:
SELECT name,content FROM <some command> (SELECT tablename FROM table1
WHERE item_id="123456")
Or is this a totally pointless thing, as the first table would need to
be so large either way? (or only good for storing large blobs and
such?)
/Frank H
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Possible to use a table to tell what table to select from?
@ 2005-07-14 08:31 Richard Huxton <dev@archonet.com>
parent: Frank Hagstrom <frank.hagstrom@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Richard Huxton @ 2005-07-14 08:31 UTC (permalink / raw)
To: Frank Hagstrom <frank.hagstrom@gmail.com>; +Cc: pgsql-sql
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?
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.
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Possible to use a table to tell what table to select from?
@ 2005-07-14 15:26 Frank Hagstrom <frank.hagstrom@gmail.com>
parent: Richard Huxton <dev@archonet.com>
0 siblings, 0 replies; 3+ messages in thread
From: Frank Hagstrom @ 2005-07-14 15:26 UTC (permalink / raw)
To: Richard Huxton <dev@archonet.com>; +Cc: pgsql-sql
On 7/14/05, Richard Huxton <dev@archonet.com> 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?
>
> 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.
>
> --
> Richard Huxton
> Archonet Ltd
>
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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-07-14 15:26 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-08 20:32 Possible to use a table to tell what table to select from? Frank Hagstrom <frank.hagstrom@gmail.com>
2005-07-14 08:31 ` Richard Huxton <dev@archonet.com>
2005-07-14 15:26 ` Frank Hagstrom <frank.hagstrom@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox