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

Fixed flakiness of the test BABEL-3592 by analysing appropriate tables #3117

Open
wants to merge 5 commits into
base: BABEL_4_X_DEV
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 95 additions & 97 deletions test/JDBC/expected/BABEL-3592.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- tsql
drop procedure if exists babel_3592_insert_multiline
go

Expand Down Expand Up @@ -25,14 +26,24 @@ go
create table babel_3592_t3(a3 int PRIMARY KEY, b3 int)
go

select set_config('babelfishpg_tsql.explain_costs', 'off', false)
go
~~START~~
text
off
~~END~~

-- psql
ANALYZE master_dbo.babel_3592_t1
GO


-- psql
ANALYZE master_dbo.babel_3592_t2
GO

-- psql
ANALYZE master_dbo.babel_3592_t3
GO

-- tsql

-- select set_config('babelfishpg_tsql.explain_costs', 'off', false)
-- go
select set_config('babelfishpg_tsql.enable_pg_hint', 'on', false);
go
~~START~~
Expand Down Expand Up @@ -77,27 +88,25 @@ GO
text
Query Text: EXEC babel_3592_insert_multiline
Query Text: insert into babel_3592_t2 select * from babel_3592_t1 where b1 = 1
-> Insert on babel_3592_t2
-> Bitmap Heap Scan on babel_3592_t1
Recheck Cond: (b1 = 1)
-> Bitmap Index Scan on index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836
Index Cond: (b1 = 1)
-> Insert on babel_3592_t2 (cost=0.00..0.00 rows=0 width=0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why there's still cost in here ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please set babelfishpg_tsql.explain_costs to off

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is experiment PR to understand difference

-> Seq Scan on babel_3592_t1 (cost=0.00..0.00 rows=1 width=8)
Filter: (b1 = 1)
Query Text: insert/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ into babel_3592_t2
select *
from babel_3592_t1
where b1 = 1
-> Insert on babel_3592_t2
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Insert on babel_3592_t2 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b1 = 1)
Query Text: insert/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ into babel_3592_t2 select * from babel_3592_t1 where b1 = 1
-> Insert on babel_3592_t2
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Insert on babel_3592_t2 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b1 = 1)
~~END~~

~~START~~
text
Babelfish T-SQL Batch Parsing Time: 0.089 ms
Babelfish T-SQL Batch Parsing Time: 0.068 ms
~~END~~


Expand All @@ -107,14 +116,14 @@ GO
text
Query Text: EXEC babel_3592_insert_singleline
Query Text: insert/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ into babel_3592_t2 select * from babel_3592_t1 where b1 = 1
-> Insert on babel_3592_t2
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Insert on babel_3592_t2 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b1 = 1)
~~END~~

~~START~~
text
Babelfish T-SQL Batch Parsing Time: 0.117 ms
Babelfish T-SQL Batch Parsing Time: 0.071 ms
Deepesh125 marked this conversation as resolved.
Show resolved Hide resolved
~~END~~


Expand Down Expand Up @@ -165,27 +174,25 @@ GO
text
Query Text: EXEC babel_3592_insert_multiline
Query Text: insert into babel_3592_t2 select * from babel_3592_t1 where b1 = 1
-> Insert on babel_3592_t2
-> Bitmap Heap Scan on babel_3592_t1
Recheck Cond: (b1 = 1)
-> Bitmap Index Scan on index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836
Index Cond: (b1 = 1)
-> Insert on babel_3592_t2 (cost=0.00..0.00 rows=0 width=0)
-> Seq Scan on babel_3592_t1 (cost=0.00..0.00 rows=1 width=8)
Filter: (b1 = 1)
Query Text: insert/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ into babel_3592_t2
select *
from babel_3592_t1
where b1 = 1
-> Insert on babel_3592_t2
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Insert on babel_3592_t2 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b1 = 1)
Query Text: insert/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ into babel_3592_t2 select * from babel_3592_t1 where b1 = 1
-> Insert on babel_3592_t2
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Insert on babel_3592_t2 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b1 = 1)
~~END~~

~~START~~
text
Babelfish T-SQL Batch Parsing Time: 0.083 ms
Babelfish T-SQL Batch Parsing Time: 0.091 ms
~~END~~


Expand All @@ -195,14 +202,14 @@ GO
text
Query Text: EXEC babel_3592_updates_singleline
Query Text: update/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ babel_3592_t1 set a1 = 1 where b1 = 1
-> Update on babel_3592_t1
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Update on babel_3592_t1 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=10)
Index Cond: (b1 = 1)
~~END~~

~~START~~
text
Babelfish T-SQL Batch Parsing Time: 0.083 ms
Babelfish T-SQL Batch Parsing Time: 0.095 ms
~~END~~


Expand Down Expand Up @@ -254,27 +261,25 @@ GO
text
Query Text: EXEC babel_3592_insert_multiline
Query Text: insert into babel_3592_t2 select * from babel_3592_t1 where b1 = 1
-> Insert on babel_3592_t2
-> Bitmap Heap Scan on babel_3592_t1
Recheck Cond: (b1 = 1)
-> Bitmap Index Scan on index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836
Index Cond: (b1 = 1)
-> Insert on babel_3592_t2 (cost=0.00..0.00 rows=0 width=0)
-> Seq Scan on babel_3592_t1 (cost=0.00..0.00 rows=1 width=8)
Filter: (b1 = 1)
Query Text: insert/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ into babel_3592_t2
select *
from babel_3592_t1
where b1 = 1
-> Insert on babel_3592_t2
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Insert on babel_3592_t2 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b1 = 1)
Query Text: insert/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ into babel_3592_t2 select * from babel_3592_t1 where b1 = 1
-> Insert on babel_3592_t2
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Insert on babel_3592_t2 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b1 = 1)
~~END~~

~~START~~
text
Babelfish T-SQL Batch Parsing Time: 0.078 ms
Babelfish T-SQL Batch Parsing Time: 0.056 ms
~~END~~


Expand All @@ -284,14 +289,14 @@ GO
text
Query Text: EXEC babel_3592_delete_singleline
Query Text: delete/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ from babel_3592_t1 where b1 = 1
-> Delete on babel_3592_t1
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Delete on babel_3592_t1 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=6)
Index Cond: (b1 = 1)
~~END~~

~~START~~
text
Babelfish T-SQL Batch Parsing Time: 0.079 ms
Babelfish T-SQL Batch Parsing Time: 0.063 ms
~~END~~


Expand Down Expand Up @@ -357,89 +362,82 @@ GO
text
Query Text: EXEC babel_3592_proc_mixed_statements
Query Text: update/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ babel_3592_t1 set a1 = 1 where b1 = 1
-> Update on babel_3592_t1
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Update on babel_3592_t1 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=10)
Index Cond: (b1 = 1)
Query Text: select/*+ nestloop(babel_3592_t1 babel_3592_t2) leading(babel_3592_t1 babel_3592_t2)*/ * from babel_3592_t1 inner join babel_3592_t2 on babel_3592_t1.a1 = babel_3592_t2.a2
-> Nested Loop
-> Seq Scan on babel_3592_t1
-> Index Scan using babel_3592_t2_pkey on babel_3592_t2
Index Cond: (a2 = babel_3592_t1.a1)
-> Nested Loop (cost=0.00..0.01 rows=1 width=16)
Join Filter: (babel_3592_t1.a1 = babel_3592_t2.a2)
-> Seq Scan on babel_3592_t1 (cost=0.00..0.00 rows=1 width=8)
-> Seq Scan on babel_3592_t2 (cost=0.00..0.00 rows=1 width=8)
Query Text: select/*+ mergejoin(babel_3592_t1 babel_3592_t2) leading(babel_3592_t1 babel_3592_t2)*/ * from babel_3592_t1 inner
join babel_3592_t2
on babel_3592_t1.a1 = babel_3592_t2.a2
-> Merge Join
-> Merge Join (cost=0.02..0.05 rows=1 width=16)
Merge Cond: (babel_3592_t1.a1 = babel_3592_t2.a2)
-> Index Scan using babel_3592_t1_pkey on babel_3592_t1
-> Index Scan using babel_3592_t2_pkey on babel_3592_t2
-> Sort (cost=0.01..0.02 rows=1 width=8)
Sort Key: babel_3592_t1.a1
-> Seq Scan on babel_3592_t1 (cost=0.00..0.00 rows=1 width=8)
-> Sort (cost=0.01..0.02 rows=1 width=8)
Sort Key: babel_3592_t2.a2
-> Seq Scan on babel_3592_t2 (cost=0.00..0.00 rows=1 width=8)
Query Text: update/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ babel_3592_t1 set a1 = 1 where b1 = 1
-> Update on babel_3592_t1
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Update on babel_3592_t1 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=10)
Index Cond: (b1 = 1)
Query Text: delete/*+ mergejoin(babel_3592_t1 babel_3592_t2) leading(babel_3592_t1 babel_3592_t2)*/ babel_3592_t1 from babel_3592_t1 inner join babel_3592_t2 on babel_3592_t1.a1 = babel_3592_t2.a2 where b1 = 1 and b2 = 1
-> Delete on babel_3592_t1
-> Merge Join
-> Delete on babel_3592_t1 (cost=0.02..0.05 rows=0 width=0)
-> Merge Join (cost=0.02..0.05 rows=1 width=12)
Merge Cond: (babel_3592_t1.a1 = babel_3592_t2.a2)
-> Sort
-> Sort (cost=0.01..0.02 rows=1 width=10)
Sort Key: babel_3592_t1.a1
-> Bitmap Heap Scan on babel_3592_t1
Recheck Cond: (b1 = 1)
-> Bitmap Index Scan on index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836
Index Cond: (b1 = 1)
-> Sort
-> Seq Scan on babel_3592_t1 (cost=0.00..0.00 rows=1 width=10)
Filter: (b1 = 1)
-> Sort (cost=0.01..0.02 rows=1 width=10)
Sort Key: babel_3592_t2.a2
-> Bitmap Heap Scan on babel_3592_t2
Recheck Cond: (b2 = 1)
-> Bitmap Index Scan on index_babel_3592_t2_b2babel_359155b730148d8fcf0167f32edb84e3f7d
Index Cond: (b2 = 1)
-> Seq Scan on babel_3592_t2 (cost=0.00..0.00 rows=1 width=10)
Filter: (b2 = 1)
Query Text: delete/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) mergejoin(babel_3592_t1 babel_3592_t2) leading(babel_3592_t1 babel_3592_t2)*/ babel_3592_t1 from babel_3592_t1 left outer join babel_3592_t2 on babel_3592_t1.a1 = babel_3592_t2.a2 where b1 = 1 and b2 = 1
-> Delete on babel_3592_t1
-> Merge Join
-> Delete on babel_3592_t1 (cost=8.16..8.19 rows=0 width=0)
-> Merge Join (cost=8.16..8.19 rows=1 width=12)
Merge Cond: (babel_3592_t1.a1 = babel_3592_t2.a2)
-> Sort
-> Sort (cost=8.15..8.16 rows=1 width=10)
Sort Key: babel_3592_t1.a1
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=10)
Index Cond: (b1 = 1)
-> Sort
-> Sort (cost=0.01..0.02 rows=1 width=10)
Sort Key: babel_3592_t2.a2
-> Bitmap Heap Scan on babel_3592_t2
Recheck Cond: (b2 = 1)
-> Bitmap Index Scan on index_babel_3592_t2_b2babel_359155b730148d8fcf0167f32edb84e3f7d
Index Cond: (b2 = 1)
-> Seq Scan on babel_3592_t2 (cost=0.00..0.00 rows=1 width=10)
Filter: (b2 = 1)
Query Text: insert
into
babel_3592_t2 select * from babel_3592_t1 where b1 = 1
-> Insert on babel_3592_t2
-> Bitmap Heap Scan on babel_3592_t1
Recheck Cond: (b1 = 1)
-> Bitmap Index Scan on index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836
Index Cond: (b1 = 1)
-> Insert on babel_3592_t2 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b1 = 1)
Query Text: insert/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ into babel_3592_t2 select * from babel_3592_t1 where b1 = 1
-> Insert on babel_3592_t2
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Insert on babel_3592_t2 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b1 = 1)
Query Text: insert/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) */ into babel_3592_t2 select * from babel_3592_t1 where b1 = 1
-> Insert on babel_3592_t2
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Insert on babel_3592_t2 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b1 = 1)
Query Text: update babel_3592_t1 set a1 = 1 where b1 = 1
-> Update on babel_3592_t1
-> Bitmap Heap Scan on babel_3592_t1
Recheck Cond: (b1 = 1)
-> Bitmap Index Scan on index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836
Index Cond: (b1 = 1)
-> Update on babel_3592_t1 (cost=0.12..8.14 rows=0 width=0)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=10)
Index Cond: (b1 = 1)
Query Text: select/*+ indexscan(babel_3592_t1 index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836) indexscan(babel_3592_t2 index_babel_3592_t2_b2babel_359155b730148d8fcf0167f32edb84e3f7d) */ * from babel_3592_t1 , babel_3592_t2 where b1 = 1 and b2 = 1
-> Nested Loop
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1
-> Nested Loop (cost=0.25..16.30 rows=1 width=16)
-> Index Scan using index_babel_3592_t1_b1babel_35976c64b612d1f74e2768783beca3bf836 on babel_3592_t1 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b1 = 1)
-> Materialize
-> Index Scan using index_babel_3592_t2_b2babel_359155b730148d8fcf0167f32edb84e3f7d on babel_3592_t2
Index Cond: (b2 = 1)
-> Index Scan using index_babel_3592_t2_b2babel_359155b730148d8fcf0167f32edb84e3f7d on babel_3592_t2 (cost=0.12..8.14 rows=1 width=8)
Index Cond: (b2 = 1)
~~END~~

~~START~~
text
Babelfish T-SQL Batch Parsing Time: 0.080 ms
Babelfish T-SQL Batch Parsing Time: 0.068 ms
~~END~~


Expand Down
Loading
Loading