Re: left join with smaller table or index on (XXX is not null) to avoid upsert

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>, pgsql-general(at)postgresql(dot)org
Subject: Re: left join with smaller table or index on (XXX is not null) to avoid upsert
Date: 2009-01-19 07:12:25
Message-ID: 2f4958ff0901182312g3841445dn3c53fb008bb5faed@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jan 19, 2009 at 2:44 AM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> wrote:
> Watch out for bloat when doing this. A simple where change of
>
> update table set b = 45 ;
>
> to
>
> update table set b = 45 where b <> 45 ;
>
> can save the db a lot of work, and if you can apply the same logic to
> your update to save some dead tuples it's worth looking into.

I wonder why DB can't do it on its own :)

--
GJ

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-01-19 07:48:28 Re: left join with smaller table or index on (XXX is not null) to avoid upsert
Previous Message Scott Marlowe 2009-01-19 02:44:40 Re: left join with smaller table or index on (XXX is not null) to avoid upsert