Why not set builder->next_phase_at=InvalidTransactionId in SnapBuildRestore function?

2022-11-24 Thread zxwsbg
Last email has some problem, I resend one. In PG14 or higher version, I notice that SnapBuildRestore function don't set builder->next_phase_at=InvalidTransactionId . But in SnapBuildSerialize function, the assert check this condition. Assert(builder->next_phase_at == InvalidTransactionId);

Re:Why not set builder->next_phase_at=InvalidTransactionId in SnapBuildRestore function?

2022-11-24 Thread zxwsbg
I don't know what happened, but an image seems to be better. -- Original -- From: "zxwsbg"

How to select unique records in PostgreSQL

2022-11-24 Thread Rama Krishnan
Hi All, I want to get the unique wallet_id from this table even it was repeated on multiple occasions I should calculate only once as well as if the wallet_id was calculated on previous month it shouldn't be calculate on next months create table student_id ( student_wallet_id int, card_id int,

Index-only scan not working when IN clause has 2 or more values

2022-11-24 Thread Anna B .
  Hi all,   CREATE TABLE transaction (     client_id     decimal(18, 0) NOT NULL,     trans_dttm    timestamp,     division_code varchar(255),     ... )   One row size = approx 2Kb.   Usually table is searched by client_id and trans_dttm, but sometimes also by division_code, so:   create index "i

About row locking ordering

2022-11-24 Thread Ryo Yamaji (Fujitsu)
Hi All. When multiple sessions tried to acquire a row lock on the same tuple sequentially, I expected that the first session waiting for the lock would acquire the lock first (FIFO). However, when we actually tested it, there were cases where a session that was behind a first session acquired a