On Sunday 02 February 2003 00:47, Alan Gutierrez wrote:
> 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.
From what people are saying Inheratance has little advantage unless you have
loads of simular tables with one or two additional columns. I take your point
on the indexes. Removing some should speed the database up and save disk
space. (Win, Win) must be more carful deciding on my indexes then...
Problem two. The trigger seams to crash the database back end when I try and
run several different quries accross multiple tables in quick sucsession. I
tries putting them in a transaction but this did not help. Run the query
indervidually did not seam to cause any problem just running them one after
the other quickly. I am trying to get it to occur from a script might have to
try it on a another small test box to try and get it too occur again.
Hmm Maybe this ought to go to Bugs. I'll post when I have found some easily
repeatable code (its only seams to be doing it from my Qt application
currently!)
Peter Childs