minimal update

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: minimal update
Date: 2007-11-02 15:49:38
Message-ID: 472B4712.3060704@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


For some time I have been working on removing some inefficiencies from a
large DW-type app. This app does a large daily batch update, and this is
what is the major bottleneck. One of the things I have been doing is to
remove unnecessary updates (which are particualrly expensive in our
index-rich setting). Several times now I have wished that there was a
switch on the UPDATE command that said "do minimal instead of maximal
updating". i.e., don't update records with identical replacements. At
the moment I have to write things like:

update tname set foo = bar ... where foo is null or foo <> bar ...

This becomes more than tedious when the update might be setting thirty
or forty fields, and I have to write such tests for each of them. It
would be so much nicer to be able to write something like:

update tname minimally set foo = bar ...

Is this an insane idea, or would it be possible, practical and useful?

cheers

andrew

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gevik Babakhani 2007-11-02 15:56:27 Re: V0.1 patch for TODO Item: SQL-language reference parameters by name.
Previous Message Gevik Babakhani 2007-11-02 15:47:54 Re: V0.1 patch for TODO Item: SQL-language reference parameters by name.