Re: insert/update performance - Mailing list pgsql-hackers

From Jinhua Luo
Subject Re: insert/update performance
Date
Msg-id CAAc9rOywTRm4CSAGST8w5q5xqou2HX7E+r1AL8poBPprb1PL3Q@mail.gmail.com
Whole thread Raw
In response to Re: insert/update performance  (Jinhua Luo <luajit.io@gmail.com>)
Responses Re: insert/update performance  (Jinhua Luo <luajit.io@gmail.com>)
List pgsql-hackers
Ok, I found the vaccum output is correct.

I check the codes of lazy_scan_heap(), the rows to be removed are
reported in two parts, one is return of heap_page_prune(), the other
is ItemIdIsDead() when scanning the page.

After scanning all pages of the relation, those rows would be clean up in:

if (vacrelstats->num_dead_tuples > 0) {
...
lazy_vacuum_heap()
...
}

It would then output
> INFO:  "test": removed 6 row versions in 1 pages

The number of rows is correct.

But what kind of rows would satisfy heap_page_prune() and what would not?

In my case all updates are doing the same thing (there is no HOT
updates, obviously), but why some updated rows are reported by
heap_page_prune() but the others are not? And it's also a random
issue. That means sometimes heap_page_prune() would report all
removable rows, and sometimes it reports no rows.


Regards,
Jinhua Luo



pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: Re: CustomScan under the Gather node?
Next
From: Pavel Stehule
Date:
Subject: Re: Why format() adds double quote?