Skip to content

Commit

Permalink
[#22387] YSQL: Fix Bitmap Scan CBO tests
Browse files Browse the repository at this point in the history
Summary:
2338431 / D34646 introduced a flag `yb_enable_bitmapscan = false`,
so YB bitmap scans are disabled by default, even when `enable_bitmapscan` is true.

At the same time, eac0c26 / D33861 introduced CBO for bitmap
scans. These tests passed before `yb_enable_bitmapscan` was added, but once it was added, they
started failing because they stopped using bitmap scans.

Fix the tests by setting `yb_enable_bitmapscan = true`.
Jira: DB-11284

Test Plan:
Jenkins: test regex: .*CostModel.*

```
./yb_build.sh --java-test 'org.yb.pgsql.TestPgCostModelSeekNextEstimation#testSeekNextEstimationBitmapScan'
./yb_build.sh --java-test
'org.yb.pgsql.TestPgCostModelSeekNextEstimation#testSeekNextEstimationBitmapScanExceedingWorkMem'
./yb_build.sh --java-test 'org.yb.pgsql.TestPgCostModelSeekNextEstimation#testSeekNextEstimationBitmapScanWithOr'
./yb_build.sh --java-test 'org.yb.pgsql.TestPgBaseScansCostModel#testBitmapScansExceedingWorkMem'
```

Reviewers: amartsinchyk, tnayak, mtakahara

Reviewed By: mtakahara

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D35044
  • Loading branch information
timothy-e committed May 14, 2024
1 parent 49a8e47 commit ca5b8e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public void testBitmapScansExceedingWorkMem() throws Exception {
stmt.execute("SET yb_enable_base_scans_cost_model = ON");
stmt.execute("SET yb_enable_optimizer_statistics = ON");
stmt.execute("SET enable_bitmapscan = TRUE");
stmt.execute("SET yb_enable_bitmapscan = TRUE");
stmt.execute(String.format("CREATE TABLE %s (pk INT, a INT, b INT, " +
"c INT, PRIMARY KEY (pk ASC))", TABLE_NAME));
stmt.execute(String.format("INSERT INTO %s SELECT i, i * 2, i / 2, NULLIF(i %% 10, 0) FROM" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public void setUp() throws Exception {
stmt.execute("SET yb_enable_base_scans_cost_model = true");
stmt.execute("SET yb_bnl_batch_size = 1024");
stmt.execute("SET enable_bitmapscan = true");
stmt.execute("SET yb_enable_bitmapscan = true");
}
}

Expand Down

0 comments on commit ca5b8e6

Please sign in to comment.