Re: History - Mailing list pgsql-general

From Alan Gutierrez
Subject Re: History
Date
Msg-id 200302011847.05686.ajglist@izzy.net
Whole thread Raw
In response to History  (Peter Childs <blue.dragon@blueyonder.co.uk>)
Responses Re: History
Re: History
Re: History
List pgsql-general
On Friday 31 January 2003 05:27, you wrote:

> Should I use inherrtance and have a different table for each table I
> want history for or one table for the lot?


>               Table "public.history"
>  Column  |            Type             | Modifiers
> ---------+-----------------------------+-----------
>  tab     | text                        |
>  field   | text                        |
>  action  | text                        |
>  before  | text                        |
>  after   | text                        |
>  occured | timestamp without time zone |
>  key     | text                        |
>  who     | text                        |
> Indexes: history_tab btree (tab),
>          history_tab_field btree (tab, field),
>          history_tab_key btree (tab, "key"),
>          history_who btree (who)

One table for the lot. If you use inheritance, it is my understanding
that it will be the same thing, since all the data will be stored in the
base table. The only thing you'd remove is the table name.

Also, you don't need indices on both (tab) and (tab, field), the
optimizer will happily use the latter, as it would the former.

--
Alan Gutierrez - ajglist@izzy.net
http://khtml-win32.sourceforge.net/ - KHTML on Windows


pgsql-general by date:

Previous
From: will trillich
Date:
Subject: Re: paradigm sanity check needed [long]
Next
From: will trillich
Date:
Subject: Re: [NOVICE] Perl - Postgres