Thread: Why do index access methods use LP_DELETE?
Hi Hackers, I found index access methods use LP_DELETE for invisible tuples, but it seems to be ok to remove LP_USED instead of adding LP_DELETE. I tried the following simple replacements: - '|= LP_DELETE' => '&= ~LP_USED' - 'ItemIdDeleted' => '!ItemIdIsUsed' and then, it passed all regression tests. Why do index access methods use LP_DELETE? Does this change make troubles? (However, I guess there is no advantage in the change,because unused items are not recycled until next vacuum.) --- ITAGAKI Takahiro NTT Cyber Space Laboratories
ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp> writes: > Why do index access methods use LP_DELETE? My recollection is that I deliberately used LP_DELETE for the known-dead-tuple marker so that there couldn't be any confusion with the use of LP_USED. AFAIR, LP_USED isn't actually used in indexes, so we could do it differently if there were another possible use for the flag bit ... have you got one in mind? regards, tom lane
Tom Lane <tgl@sss.pgh.pa.us> wrote: > > Why do index access methods use LP_DELETE? > > My recollection is that I deliberately used LP_DELETE for the > known-dead-tuple marker so that there couldn't be any confusion with > the use of LP_USED. AFAIR, LP_USED isn't actually used in indexes, > so we could do it differently if there were another possible use for > the flag bit ... have you got one in mind? Thanks. I understood there is little difference between non-LP_USED and LP_DELETE for indexes. I'm thinking to use LP_DELETE for relation tuples for incremental vacuum, which is discussed in http://archives.postgresql.org/pgsql-hackers/2005-03/msg00518.php I'll try to mark tuples with LP_DELETE on visibility checking and recycle the pages by bgwriter. ...However it is still a stage of an idea. --- ITAGAKI Takahiro NTT Cyber Space Laboratories