UPSERT and HOT-update

Поиск
Список
Период
Сортировка
От CHENG Yuk-Pong, Daniel
Тема UPSERT and HOT-update
Дата
Msg-id CAOcLnUcsSw+G30kyc5UurDoZWh9yqMb+1aO6ixQXh0yEN8RTzg@mail.gmail.com
обсуждение исходный текст
Ответы Re: UPSERT and HOT-update  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-general
Hi List,

I am doing a INSERT...ON CONFLICT...UPDATE.. on a table. The query is
mostly-UPDATE and does not change any columns most of the time, like
so:

  CREATE INDEX ON book(title);
  INSERT INTO book (isbn, title, author, lastupdate) VALUES ($1,$2,$3, now())
    ON CONFLICT (isbn) DO UPDATE set title=excluded.title,
author=excluded.author, lastupdate=excluded.lastupdate;

PostgreSQL seems to consider the title as changed and refused to do a
HOT-update. It works if I remove the `title=...` part.

Are there any tricks to make it smarter? The title don't change most
of the time after all.

Regards,
Daniel


В списке pgsql-general по дате отправления:

Предыдущее
От: David Steele
Дата:
Сообщение: Re: [HACKERS] Request - repeat value of \pset title during \watch interations
Следующее
От: Ranier VF
Дата:
Сообщение: Error: insufficient data in the message