Re: Speed of lo_unlink vs. DELETE on BYTEA

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Reuven M(dot) Lerner *EXTERN*" <reuven(at)lerner(dot)co(dot)il>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Speed of lo_unlink vs. DELETE on BYTEA
Date: 2011-09-23 10:48:15
Message-ID: D960CB61B694CF459DCFB4B0128514C2049FCE78@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Reuven M. Lerner wrote:
> When a record in the main table is deleted, there is a rule (yes a rule -- not a trigger) in the
> referencing table that performs a lo_unlink on the associated object.

> I just want to check that my intuition is correct: Wouldn't it be way faster and more efficient
> for us to use BYTEA columns to store the data (which can get into the 20-50 MB range),
> and for us to just depend on ON DELETE CASCADE, rather than a rule?
[followed by dramatic performance numbers]

Could you try with a trigger instead of a rule and see if the performance is better?

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stéphane A. Schildknecht 2011-09-23 10:53:55 Re: Relative performance of prefix and suffix string matching
Previous Message Alban Hertroys 2011-09-23 10:41:02 Re: Query performs badly with materialize node