Re: Rename dead_tuples to dead_items in vacuumlazy.c

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Rename dead_tuples to dead_items in vacuumlazy.c
Дата
Msg-id 202111241753.qub6szl2nrvg@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Rename dead_tuples to dead_items in vacuumlazy.c  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: Rename dead_tuples to dead_items in vacuumlazy.c  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
On 2021-Nov-24, Peter Geoghegan wrote:

> TIDs (ItemPointerData structs) are of course not the same thing as
> line pointers (ItemIdData structs). There is a tendency to refer to
> the latter as "item pointers" all the same, which was confusing. I
> personally corrected/normalized this in commit ae7291ac in 2019. I
> think that it's worth being careful about precisely because they're
> closely related (but distinct) concepts. And so FWIW "LP_DEAD item
> pointer" is not a thing. I agree that an LP_DEAD item pointer has no
> tuple storage, and so you could say that it points to nothing (though
> only in heapam). I probably would just say that it has no tuple
> storage, though.

OK, this makes a lot more sense.  I wasn't aware of ae7291ac (and I
wasn't aware of the significance of 8523492d either, but that's not
really relevant here.)

> I agree with others that the term "item" is vague, but I don't think
> that that's necessarily a bad thing here -- I deliberately changed the
> comments to say either "TIDs" or "LP_DEAD items", emphasizing whatever
> the important aspect seemed to be in each context (they're LP_DEAD
> items to the heap structure, TIDs to index structures).

I think we could say "LP_DEAD line pointer" and that would be perfectly
clear.  Given how nuanced we have to be if we want to be clear about
this, I would rather not use "LP_DEAD item"; that seems slightly
contradictory, since the item is the storage and such a line pointer
does not have storage.  Perhaps change that define in progress.h to
PROGRESS_VACUUM_NUM_DEAD_LPS, and, in the first comment in vacuumlazy.c,
use wording such as

+ * The major space usage for LAZY VACUUM is storage for the array of TIDs
+ * of dead line pointers that are to be removed from indexes.

or

+ * The major space usage for LAZY VACUUM is storage for the array of TIDs
+ * of LP_DEAD line pointers that are to be removed from indexes.

(The point being that TIDs are not dead themselves, only the line
pointers that they refer to.)

-- 
Álvaro Herrera           39°49'30"S 73°17'W  —  https://www.EnterpriseDB.com/
"Most hackers will be perfectly comfortable conceptualizing users as entropy
 sources, so let's move on."                               (Nathaniel Smith)



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Python 3.11 vs. Postgres
Следующее
От: Robert Haas
Дата:
Сообщение: Re: pgsql: xlog.c: Remove global variables ReadRecPtr and EndRecPtr.