Re: does dml operations load the blocks to the shared buffers ?

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Mariel Cherkassky <mariel(dot)cherkassky(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-performance(at)postgresql(dot)org>
Subject: Re: does dml operations load the blocks to the shared buffers ?
Date: 2019-01-10 18:42:33
Message-ID: CAECtzeWzp+PNXB6+OaQsUU5X2DwdDS6VToYSYvTtYq0sv3DD-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Le jeu. 10 janv. 2019 à 11:40, Mariel Cherkassky <
mariel(dot)cherkassky(at)gmail(dot)com> a écrit :

> . Lets assume the amount of data I insert is bigger than the
> shared_buffers. I didnt commit the transaction yet, the data will be saved
> on temp files until I commit ?
> What happens if I have in my transaction,I did a lot of changes and I
> filled the wal_buffers / shared buffers but I still didnt commit. How the
> database will handle it ?
>

Please, don't top-post. It makes it hard to follow the thread.

Whatever happens, it will get to disk in the data files, and it doesn't
actually matter. The database has system informations on the datafiles (on
each tuple actually) that will allow to make the distinction between
commited tuples, rollbacked tuples and not-yet-committed-or-rollbacked
tuples.

> ‫בתאריך יום ה׳, 10 בינו׳ 2019 ב-10:55 מאת ‪Guillaume Lelarge‬‏ <‪
> guillaume(at)lelarge(dot)info‬‏>:‬
>
>> Le jeu. 10 janv. 2019 à 09:07, Mariel Cherkassky <
>> mariel(dot)cherkassky(at)gmail(dot)com> a écrit :
>>
>>> Hey,
>>> It is clear that when we query some data, if that data isnt in the
>>> shared buffers pg will go bring the relevant blocks from the disk to the
>>> shared buffers. I wanted to ask if the same logic works with
>>> dml(insert/update/delete). I'm familiar with the writing logic, that the
>>> checkpointer is the process that writing the data changes into the data
>>> files during every checkpoint and that the commit write the changes from
>>> the wal buffers to to the wal files. I wanted to ask about a situation
>>> where we run dmls and that data isnt available in the shared buffers.
>>>
>>>
>> It works the same.
>>
>>
>> --
>> Guillaume.
>>
>

--
Guillaume.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Etsuro Fujita 2019-01-11 02:21:01 Re: Query with high planning time at version 11.1 compared versions 10.5 and 11.0
Previous Message Thomas Güttler 2019-01-10 12:56:02 Detect missing combined indexes (automatically)