Re: TRUNCATE memory leak with temporary tables?

From: Ravi Krishna <ravikrishna3(at)icloud(dot)com>
To: Ahmet Demir <dbademir(at)gmail(dot)com>
Cc: Vijaykumar Jain <vijaykumarjain(dot)github(at)gmail(dot)com>, Nick Muerdter <stuff(at)nickm(dot)org>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: TRUNCATE memory leak with temporary tables?
Date: 2021-05-28 12:40:33
Message-ID: afc4c02a-9b1c-4294-b9ab-a6bdc85b6af1@me.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am not sure about that
"It creates a new empty table , followed by rename of the existing table to the new empty table and finally dropping of the old table."

You mean table is re-created with new oid?

I don't think oid changes, but the file relnode on the disk changes. So let me rephrase it

truncate does the following:

1 - create a new empty file on the disk.
2 - at commit time, map the table oid to the new empty file.
3 - drop the old file.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael van der Kolff 2021-05-28 13:13:22 Re: Modelling versioning in Postgres
Previous Message Ahmet Demir 2021-05-28 12:23:15 Re: TRUNCATE memory leak with temporary tables?