Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EXPLAIN options (COSTS false) for some tests #148

Closed
wants to merge 1 commit into from

Conversation

mikecaat
Copy link
Contributor

The commit adds the EXPLAIN OPTION '(COSTS false)' for test stability, because some tests don't need to check the costs.

make installcheck is failed after postgres/postgres@d37ab37 is committed because the costs is changed.
(Might this only happen in my environment?)

diff -U3 /home/ikedamsh/repos/psql/extension/pg_hint_plan/expected/ut-A.out /home/ikedamsh/repos/psql/extension/pg_hint_plan/results/ut-A.out
--- /home/ikedamsh/repos/psql/extension/pg_hint_plan/expected/ut-A.out	2023-08-25 15:35:53.393621985 +0900
+++ /home/ikedamsh/repos/psql/extension/pg_hint_plan/results/ut-A.out	2023-08-25 15:36:43.473621489 +0900
@@ -4789,7 +4789,7 @@
 EXPLAIN EXECUTE p1;
                       QUERY PLAN                      
 ------------------------------------------------------
- Seq Scan on tpc  (cost=0.00..17.50 rows=333 width=4)
+ Seq Scan on tpc  (cost=0.00..20.50 rows=333 width=4)
    Filter: (a < 999)
 (2 rows)
 
@@ -4803,7 +4803,7 @@
 
                                QUERY PLAN                               
 ------------------------------------------------------------------------
- Index Scan using tpc_a_idx on tpc  (cost=0.28..34.10 rows=333 width=4)
+ Index Scan using tpc_a_idx on tpc  (cost=0.28..46.10 rows=333 width=4)
    Index Cond: (a < 999)
 (2 rows)
 
@@ -4817,7 +4817,7 @@
 
                      QUERY PLAN                     
 ----------------------------------------------------
- Seq Scan on tpc  (cost=0.00..17.50 rows=5 width=4)
+ Seq Scan on tpc  (cost=0.00..20.50 rows=5 width=4)
    Filter: (a = 500)
 (2 rows)
 
@@ -4828,7 +4828,7 @@
 EXPLAIN EXECUTE p1;
                       QUERY PLAN                      
 ------------------------------------------------------
- Seq Scan on tpc  (cost=0.00..17.50 rows=333 width=4)
+ Seq Scan on tpc  (cost=0.00..20.50 rows=333 width=4)
    Filter: (a < 999)
 (2 rows)
 
@@ -4842,7 +4842,7 @@
 
                                QUERY PLAN                               
 ------------------------------------------------------------------------
- Index Scan using tpc_a_idx on tpc  (cost=0.28..34.10 rows=333 width=4)
+ Index Scan using tpc_a_idx on tpc  (cost=0.28..46.10 rows=333 width=4)
    Index Cond: (a < 999)
 (2 rows)
 
@@ -4856,7 +4856,7 @@
 
                      QUERY PLAN                     
 ----------------------------------------------------
- Seq Scan on tpc  (cost=0.00..17.50 rows=5 width=4)
+ Seq Scan on tpc  (cost=0.00..20.50 rows=5 width=4)
    Filter: (a = 500)
 (2 rows)

Although only ut-A is failed on my laptop, I also fix ut-T because I have found that it can cause the same problem with the following query.

$ grep -r "cost="  | grep -v "cost=x" | grep -v "cost={inf"

The commit adds the EXPLAIN OPTION '(COSTS false)'
for test stability, because some tests don't need to
check the costs.
@mikecaat
Copy link
Contributor Author

mikecaat commented Aug 25, 2023

BTW, the costs changed because the number of relpages is changed in my laptop. It seems reasonable because the commit
changes the logic of extending relation.

# One commit before postgres/postgres@d37ab37
=# SELECT relpages FROM pg_class WHERE relname = 'tpc';
 relpages 
----------
        5
(1 row)

# postgres/postgres@d37ab37
=# SELECT relpages FROM pg_class WHERE relname = 'tpc';
 relpages
----------
        8
(1 row)

@michaelpq
Copy link
Collaborator

Okay, thanks for this one. Applied down to 11, even if the difference only showed up on HEAD.

@michaelpq michaelpq closed this Aug 29, 2023
michaelpq added a commit that referenced this pull request Aug 29, 2023
The commit adds the EXPLAIN OPTION '(COSTS false)' to improve the test
stability, as these can get influences by upstream if the costing model
changes for a reason or another like the recent upstrean change
82a4edabd272.

This change does not influence the coverage of the test as the plans are
the same, just the output produced.

Per pull request #148.

Author: Masahiro Ikeda
Backpatch-through: 11
michaelpq added a commit that referenced this pull request Aug 29, 2023
The commit adds the EXPLAIN OPTION '(COSTS false)' to improve the test
stability, as these can get influences by upstream if the costing model
changes for a reason or another like the recent upstrean change
82a4edabd272.

This change does not influence the coverage of the test as the plans are
the same, just the output produced.

Per pull request #148.

Author: Masahiro Ikeda
Backpatch-through: 11
michaelpq added a commit that referenced this pull request Aug 29, 2023
The commit adds the EXPLAIN OPTION '(COSTS false)' to improve the test
stability, as these can get influences by upstream if the costing model
changes for a reason or another like the recent upstrean change
82a4edabd272.

This change does not influence the coverage of the test as the plans are
the same, just the output produced.

Per pull request #148.

Author: Masahiro Ikeda
Backpatch-through: 11
michaelpq added a commit that referenced this pull request Aug 29, 2023
The commit adds the EXPLAIN OPTION '(COSTS false)' to improve the test
stability, as these can get influences by upstream if the costing model
changes for a reason or another like the recent upstrean change
82a4edabd272.

This change does not influence the coverage of the test as the plans are
the same, just the output produced.

Per pull request #148.

Author: Masahiro Ikeda
Backpatch-through: 11
michaelpq added a commit that referenced this pull request Aug 29, 2023
The commit adds the EXPLAIN OPTION '(COSTS false)' to improve the test
stability, as these can get influences by upstream if the costing model
changes for a reason or another like the recent upstrean change
82a4edabd272.

This change does not influence the coverage of the test as the plans are
the same, just the output produced.

Per pull request #148.

Author: Masahiro Ikeda
Backpatch-through: 11
michaelpq added a commit that referenced this pull request Aug 29, 2023
The commit adds the EXPLAIN OPTION '(COSTS false)' to improve the test
stability, as these can get influences by upstream if the costing model
changes for a reason or another like the recent upstrean change
82a4edabd272.

This change does not influence the coverage of the test as the plans are
the same, just the output produced.

Per pull request #148.

Author: Masahiro Ikeda
Backpatch-through: 11
@mikecaat mikecaat deleted the make_test_stable branch August 29, 2023 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants