Fixing pgbench init overflow

From: Chen Hao Hsu <johnhyvr(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Fixing pgbench init overflow
Date: 2023-12-22 23:18:16
Message-ID: CA+-JvFvHsOafjHcuFPfkyouHNZvbOXhBNhwZxKm3WNgYz9bwzA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

pgbench mixes int and int64 to initialize the tables.
When a large enough scale factor is passed, initPopulateTable
overflows leading to it never completing, ie.

2147400000 of 2200000000 tuples (97%) of
pgbench_accounts done (elapsed 4038.83 s, remaining 98.93 s)
-2147400000 of 2200000000 tuples (-97%) of
pgbench_accounts done (elapsed 4038.97 s, remaining -8176.86 s)

Attached is a patch that fixes this, pgbench -i -s 22000 works now.

--
John Hsu - Amazon Web Services

Attachment Content-Type Size
0001-Fix-pgbench-init-overflow-when-total-number-of-rows.patch application/octet-stream 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2023-12-23 00:32:26 Re: Transaction timeout
Previous Message Przemysław Sztoch 2023-12-22 22:25:51 Re: date_trunc function in interval version