1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-27 22:56:53 +03:00

Correct comment of pgbench "filler" columns.

Pavan Deolasee
This commit is contained in:
Fujii Masao 2013-09-30 12:35:54 +09:00
parent 42bf7fc1de
commit 514b3194e8

View File

@ -1537,11 +1537,13 @@ init(bool is_no_vacuum)
/* /*
* Note: TPC-B requires at least 100 bytes per row, and the "filler" * Note: TPC-B requires at least 100 bytes per row, and the "filler"
* fields in these table declarations were intended to comply with that. * fields in these table declarations were intended to comply with that.
* But because they default to NULLs, they don't actually take any space. * The pgbench_accounts table complies with that because the "filler"
* We could fix that by giving them non-null default values. However, that * column is set to blank-padded empty string. But for all other tables the
* would completely break comparability of pgbench results with prior * column defaults to NULL and so don't actually take any space. We could
* versions. Since pgbench has never pretended to be fully TPC-B * fix that by giving them non-null default values. However, that would
* compliant anyway, we stick with the historical behavior. * completely break comparability of pgbench results with prior versions.
* Since pgbench has never pretended to be fully TPC-B compliant anyway, we
* stick with the historical behavior.
*/ */
struct ddlinfo struct ddlinfo
{ {
@ -1640,12 +1642,14 @@ init(bool is_no_vacuum)
for (i = 0; i < nbranches * scale; i++) for (i = 0; i < nbranches * scale; i++)
{ {
/* "filler" column defaults to NULL */
snprintf(sql, 256, "insert into pgbench_branches(bid,bbalance) values(%d,0)", i + 1); snprintf(sql, 256, "insert into pgbench_branches(bid,bbalance) values(%d,0)", i + 1);
executeStatement(con, sql); executeStatement(con, sql);
} }
for (i = 0; i < ntellers * scale; i++) for (i = 0; i < ntellers * scale; i++)
{ {
/* "filler" column defaults to NULL */
snprintf(sql, 256, "insert into pgbench_tellers(tid,bid,tbalance) values (%d,%d,0)", snprintf(sql, 256, "insert into pgbench_tellers(tid,bid,tbalance) values (%d,%d,0)",
i + 1, i / ntellers + 1); i + 1, i / ntellers + 1);
executeStatement(con, sql); executeStatement(con, sql);
@ -1675,6 +1679,7 @@ init(bool is_no_vacuum)
{ {
int64 j = k + 1; int64 j = k + 1;
/* "filler" column defaults to blank padded empty string */
snprintf(sql, 256, INT64_FORMAT "\t" INT64_FORMAT "\t%d\t\n", j, k / naccounts + 1, 0); snprintf(sql, 256, INT64_FORMAT "\t" INT64_FORMAT "\t%d\t\n", j, k / naccounts + 1, 0);
if (PQputline(con, sql)) if (PQputline(con, sql))
{ {