Re: [GENERAL] Trigger Performance

2011-01-17 Thread Jasen Betts
On 2011-01-17, Fredric Fredricson wrote: > This is a multi-part message in MIME format. > --00060003050104030402 > Content-Type: text/plain; charset=UTF-8; format=flowed > Content-Transfer-Encoding: 7bit > > On 01/15/2011 11:52 PM, Randall Smith wrote: >> Hi, >> >> I've created a t

Re: [GENERAL] Trigger Performance

2011-01-17 Thread Jasen Betts
On 2011-01-16, Randall Smith wrote: > Before reading. This is solved. Was an error on my part. > > On Sun, 2011-01-16 at 03:46 +, Jasen Betts wrote: >> In plpgsql IF is an implicit select. >> >> >> IF EXISTS

Re: [GENERAL] Trigger Performance

2011-01-16 Thread Fredric Fredricson
On 01/15/2011 11:52 PM, Randall Smith wrote: Hi, I've created a trigger that checks the uniqueness of two columns in a table. Traditionally, one would use a unique constraint, but in my case, the size of the unique index would be too large and some performance loss is acceptable. However, the

Re: [GENERAL] Trigger Performance

2011-01-16 Thread Tom Lane
Randall Smith writes: > I've created a trigger that checks the uniqueness of two columns in a > table. Traditionally, one would use a unique constraint, but in my > case, the size of the unique index would be too large and some > performance loss is acceptable. However, the trigger performance s

Re: [GENERAL] Trigger Performance

2011-01-16 Thread Alban Hertroys
On 16 Jan 2011, at 5:38, Randall Smith wrote: >> But you already do have an index on that id-field, so what's the problem >> with using a unique constraint? Its unique index could just replace the >> existing one. > > I'm OK with indexing the 8 byte integer, but I don't want to index the > text

Re: [GENERAL] Trigger Performance

2011-01-15 Thread Randall Smith
Before reading. This is solved. Was an error on my part. On Sun, 2011-01-16 at 03:46 +, Jasen Betts wrote: > In plpgsql IF is an implicit select. > > > IF EXISTS (SELECT 1 FROM t1 WHERE > volume_id

Re: [GENERAL] Trigger Performance

2011-01-15 Thread Jasen Betts
On 2011-01-15, Randall Smith wrote: > Hi, > > I've created a trigger that checks the uniqueness of two columns in a > table. Traditionally, one would use a unique constraint, but in my > case, the size of the unique index would be too large and some > performance loss is acceptable. However, the

Re: [GENERAL] Trigger Performance

2011-01-15 Thread Alban Hertroys
On 15 Jan 2011, at 23:52, Randall Smith wrote: > Hi, > > I've created a trigger that checks the uniqueness of two columns in a > table. Traditionally, one would use a unique constraint, but in my > case, the size of the unique index would be too large and some > performance loss is acceptable.