| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Grant McLean <grant(at)catalyst(dot)net(dot)nz> |
| Cc: | Rune Froysa <orfenur(at)ulrik(dot)uio(dot)no>, pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Slow deletion of data from tables |
| Date: | 2004-07-10 04:41:20 |
| Message-ID: | 2840.1089434480@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Grant McLean <grant(at)catalyst(dot)net(dot)nz> writes:
> On Fri, 2004-07-02 at 04:35, Rune Froysa wrote:
>> I have one table with columns that are used as foreign-keys from
>> several other tables. Sometimes deletion from this table takes +5
>> seconds for a single row.
> Do you have indexes on the foreign key columns in the child tables?
Also: if you do have indexes on the referenced columns, they may still
not get used because of datatype mismatches. It's generally a good idea
to make sure that referenced and referencing columns of a foreign-key
constraint have exactly the same datatype.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2004-07-10 04:49:16 | Re: Difference in text/char data matching between 7.3.4 & 7.4.2 |
| Previous Message | Tom Lane | 2004-07-10 04:03:23 | Re: SUBSTRING for a regular expression |