On Mon, Jun 27, 2005 at 18:46:58 +0300,
Catalin Constantin <catalin@bounce-software.com> wrote:
> Hello,
>
> I have a pretty big database with about 200 000 rows.
> This is the main table. Also some other tables with FKs to this main
> table.
>
> I have to calculate some numbers for each entry at a certain amount of
> time and update the DB.
>
> I've noticed the update TAKES a very long time.
Do you have indexes on the foreign key fields in the referencing tables?
These are created by default and if you are updating the referenced tupples
a sequential search will be needed if there isn't an index.
Also of note is that there is recent a change to only do this if the referenced
fields in the record are changed, but I think this is new for 8.1. That
will make things go a lot faster if you aren't updating the referenced
fields in your main table.