Skip to content

Commit 514b319

Browse files
committed
Correct comment of pgbench "filler" columns.
Pavan Deolasee
1 parent 42bf7fc commit 514b319

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

contrib/pgbench/pgbench.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,11 +1537,13 @@ init(bool is_no_vacuum)
15371537
/*
15381538
* Note: TPC-B requires at least 100 bytes per row, and the "filler"
15391539
* fields in these table declarations were intended to comply with that.
1540-
* But because they default to NULLs, they don't actually take any space.
1541-
* We could fix that by giving them non-null default values. However, that
1542-
* would completely break comparability of pgbench results with prior
1543-
* versions. Since pgbench has never pretended to be fully TPC-B
1544-
* compliant anyway, we stick with the historical behavior.
1540+
* The pgbench_accounts table complies with that because the "filler"
1541+
* column is set to blank-padded empty string. But for all other tables the
1542+
* column defaults to NULL and so don't actually take any space. We could
1543+
* fix that by giving them non-null default values. However, that would
1544+
* completely break comparability of pgbench results with prior versions.
1545+
* Since pgbench has never pretended to be fully TPC-B compliant anyway, we
1546+
* stick with the historical behavior.
15451547
*/
15461548
struct ddlinfo
15471549
{
@@ -1640,12 +1642,14 @@ init(bool is_no_vacuum)
16401642

16411643
for (i = 0; i < nbranches * scale; i++)
16421644
{
1645+
/* "filler" column defaults to NULL */
16431646
snprintf(sql, 256, "insert into pgbench_branches(bid,bbalance) values(%d,0)", i + 1);
16441647
executeStatement(con, sql);
16451648
}
16461649

16471650
for (i = 0; i < ntellers * scale; i++)
16481651
{
1652+
/* "filler" column defaults to NULL */
16491653
snprintf(sql, 256, "insert into pgbench_tellers(tid,bid,tbalance) values (%d,%d,0)",
16501654
i + 1, i / ntellers + 1);
16511655
executeStatement(con, sql);
@@ -1675,6 +1679,7 @@ init(bool is_no_vacuum)
16751679
{
16761680
int64 j = k + 1;
16771681

1682+
/* "filler" column defaults to blank padded empty string */
16781683
snprintf(sql, 256, INT64_FORMAT "\t" INT64_FORMAT "\t%d\t\n", j, k / naccounts + 1, 0);
16791684
if (PQputline(con, sql))
16801685
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy