From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Fran Fabrizio <ffabrizio(at)Exchange(dot)WebMD(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: DBI/AutoCommit/Postgres |
Date: | 2001-04-30 23:21:03 |
Message-ID: | 721.988672863@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Fran Fabrizio <ffabrizio(at)Exchange(dot)WebMD(dot)net> writes:
> Another crucial piece of information is that each insert kicks off a
> trigger. I did not write the trigger, and do not know how to write
> triggers, but I think that might be the contributing factor to the
> slowness.
Bingo. Your trigger is adding four complete queries (two selects and
two inserts or updates) for every row inserted.
Think about ways to avoid some or all of those. (For example, does the
knownhosts table really need a last_contact column, or could you obtain
that on-the-fly from a query over the incoming or status table when
needed?) Also look to see if these are being done with reasonable query
plans ... perhaps you need some indexes and/or vacuum operations ...
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Eugene Lee | 2001-04-30 23:27:33 | TRUNCATE and INDEXes |
Previous Message | Joel Burton | 2001-04-30 22:57:34 | Re: PHPPgAdmin or MS Access |