[HACKERS] Unused variable scanned_tuples in LVRelStats - Mailing list pgsql-hackers

From Masahiko Sawada
Subject [HACKERS] Unused variable scanned_tuples in LVRelStats
Date
Msg-id CAD21AoAMuG8Pbr7GUim5LLCi4wgL2-=q1Gp-P8_0tyYDHtq13g@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] Unused variable scanned_tuples in LVRelStats
List 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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] pg_stop_backup(wait_for_archive := true) on standby server
Next
From: Noah Misch
Date:
Subject: Re: [HACKERS] Reducing runtime of stats regression test