Re: Use heap scan routines directly in vac_update_datfrozenxid()
От | Alvaro Herrera |
---|---|
Тема | Re: Use heap scan routines directly in vac_update_datfrozenxid() |
Дата | |
Msg-id | 202410070858.qmyeb2obl7gb@alvherre.pgsql обсуждение исходный текст |
Ответ на | Re: Use heap scan routines directly in vac_update_datfrozenxid() (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
On 2024-Oct-06, Tom Lane wrote: > Soumyadeep Chakraborty <soumyadeep2007@gmail.com> writes: > > Attached is a simple patch to directly use heap scan routines in > > vac_update_datfrozenxid(), avoiding the multilayer overhead from the > > sysscan infrastructure. Though if there's anybody with a Postgres fork using catalog tables that aren't heapam, then they aren't going to be happy with this change. (I remember Tom commenting that Salesforce used to do that, I wonder if they still do.) > I would think the overhead of that is minuscule. If it isn't, > we should try to make it so, not randomly hack up some of the callers > to avoid it. The intention certainly was that it wouldn't cost > anything compared to what happens within the actual table access. I suspect the problem is not the systable layer per se, but the fact that it has to go through the table AM interface. So by replacing systable with the heap routines, it's actually _two_ layers of indirection that are being skipped over. systable seems indeed quite lean, or at least it was up to postgres 11 ... but it's not clear to me that it continues to be. The table AM API is heavily centered on slots, and I think having to build heap tuples from slots might be slow. I wonder if it would be better to add "systable_getnext_slot" which returns a slot and omit the conversion to heaptuple. Callers for which it's significant could skip that conversion by dealing with a slot instead. Converting just one or two critical spots (such as vac_update_datfrozenxid, maybe pg_publication.c) should be easy enough. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Ellos andaban todos desnudos como su madre los parió, y también las mujeres, aunque no vi más que una, harto moza, y todos los que yo vi eran todos mancebos, que ninguno vi de edad de más de XXX años" (Cristóbal Colón)
В списке pgsql-hackers по дате отправления: