From: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
---|---|
To: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Unused variable scanned_tuples in LVRelStats |
Date: | 2017-07-05 02:13:06 |
Message-ID: | CAD21AoAMuG8Pbr7GUim5LLCi4wgL2-=q1Gp-P8_0tyYDHtq13g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
scanned_tuples variable in LVRelStats is introduced by commit b4b6923e
but it seems to me that it's actually not used. We store num_tuples
into vacrelstats->scanned_tuples after scanned all blocks, and the
comment mentioned that saving it in order to use later but we actually
use num_tuples instead of vacrelstats->scanned_tuples from there. I
think the since the name of scanned_tuples implies more clearer
purpose than num_tuples it's better to use it instead of num_tuples,
or we can remove scanned_tuples from LVRelStats.
/* save stats for use later */
vacrelstats->scanned_tuples = num_tuples;
vacrelstats->tuples_deleted = tups_vacuumed;
vacrelstats->new_dead_tuples = nkeep;
Attached small path fixes this.
Regards,
--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
Attachment | Content-Type | Size |
---|---|---|
fix_vacuumlazy.patch | application/octet-stream | 998 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Noah Misch | 2017-07-05 02:23:04 | Re: Reducing runtime of stats regression test |
Previous Message | Masahiko Sawada | 2017-07-05 01:19:34 | Re: pg_stop_backup(wait_for_archive := true) on standby server |