PG18: Stabilize EXPLAIN output by disabling ANALYZE in index-scan test (#8322)

fixes #8318 

PostgreSQL 18 started printing an extra line in `EXPLAIN (ANALYZE …)`
for index scans:

```
Index Searches: N
```

This makes our test output flap (extra line, footer row count changes)
while the intent of the test is simply to **prove we plan an index
scan**, not to assert runtime counters.

### What this PR does

  ```sql
  EXPLAIN (... analyze on, ...)
  ```

  to

  ```sql
  EXPLAIN (... analyze off, ...)
  ```

### Why this approach

* **Minimal change**: keeps the test’s purpose (“we exercise an index
scan”) without introducing normalization rules
* **Version-stable**: avoids PG18’s new text while remaining valid on
PG15–PG18.
* **No behavioral impact**: we still validate the plan node is an Index
Scan; we just don’t request execution.

### Before → After (essence)

Before (PG18):

```
Aggregate
  ->  Index Scan ... (actual rows=1 loops=1)
        Index Cond: ...
        Index Searches: 1
```

After:

```
Aggregate
  ->  Index Scan ...
        Index Cond: ...
```
colm/PG18-merge-main
Mehmet YILMAZ 2025-11-05 16:53:36 +03:00 committed by GitHub
parent b63572d72f
commit b10aa02908
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 10 deletions

View File

@ -184,12 +184,12 @@ SELECT count(*) FROM less_common_data_types_table WHERE dist_key = 1 AND col1 =
set columnar.enable_custom_scan to 'off';
set enable_seqscan to off;
set seq_page_cost TO 10000000;
EXPLAIN (costs off, timing off, summary off, analyze on, BUFFERS OFF)
EXPLAIN (costs off, timing off, summary off, analyze off, BUFFERS OFF)
SELECT count(*) FROM less_common_data_types_table WHERE dist_key = 1 AND col1 = ARRAY[1];
QUERY PLAN
---------------------------------------------------------------------
Aggregate (actual rows=1 loops=1)
-> Index Scan using non_unique_index_on_columnar on less_common_data_types_table (actual rows=1 loops=1)
Aggregate
-> Index Scan using non_unique_index_on_columnar on less_common_data_types_table
Index Cond: ((dist_key = 1) AND (col1 = '{1}'::integer[]))
(3 rows)

View File

@ -337,12 +337,12 @@ SELECT count(*) FROM less_common_data_types_table WHERE dist_key = 1 AND col1 =
set columnar.enable_custom_scan to 'off';
set enable_seqscan to off;
set seq_page_cost TO 10000000;
EXPLAIN (costs off, timing off, summary off, analyze on, BUFFERS OFF)
EXPLAIN (costs off, timing off, summary off, analyze off, BUFFERS OFF)
SELECT count(*) FROM less_common_data_types_table WHERE dist_key = 1 AND col1 = ARRAY[1];
QUERY PLAN
---------------------------------------------------------------------
Aggregate (actual rows=1 loops=1)
-> Index Scan using non_unique_index_on_columnar on less_common_data_types_table (actual rows=1 loops=1)
Aggregate
-> Index Scan using non_unique_index_on_columnar on less_common_data_types_table
Index Cond: ((dist_key = 1) AND (col1 = '{1}'::integer[]))
(3 rows)

View File

@ -65,7 +65,7 @@ set columnar.enable_custom_scan to 'off';
set enable_seqscan to off;
set seq_page_cost TO 10000000;
EXPLAIN (costs off, timing off, summary off, analyze on, BUFFERS OFF)
EXPLAIN (costs off, timing off, summary off, analyze off, BUFFERS OFF)
SELECT count(*) FROM less_common_data_types_table WHERE dist_key = 1 AND col1 = ARRAY[1];
-- make sure that we re-enable columnar scan

View File

@ -253,7 +253,7 @@ set columnar.enable_custom_scan to 'off';
set enable_seqscan to off;
set seq_page_cost TO 10000000;
EXPLAIN (costs off, timing off, summary off, analyze on, BUFFERS OFF)
EXPLAIN (costs off, timing off, summary off, analyze off, BUFFERS OFF)
SELECT count(*) FROM less_common_data_types_table WHERE dist_key = 1 AND col1 = ARRAY[1];
-- make sure that we re-enable columnar scan