6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Added/Updated tests\functional\arno\optimizer\test_opt_sort_by_index_18.py: 'OPTIMIZE FOR FIRST ROWS' is used for 6.x - suggesed by dimitr, letter 16.11.2024 15:15. Checked on 6.0.0.532; 5.0.2.1567

This commit is contained in:
pavel-zotov 2024-11-17 13:51:40 +03:00
parent 7982277e69
commit 5709c6696c

View File

@ -9,10 +9,9 @@ DESCRIPTION:
FBTEST: functional.arno.optimizer.opt_sort_by_index_18 FBTEST: functional.arno.optimizer.opt_sort_by_index_18
NOTES: NOTES:
[17.11.2024] pzotov [17.11.2024] pzotov
Re-implemented after https://github.com/FirebirdSQL/firebird/commit/26e64e9c08f635d55ac7a111469498b3f0c7fe81 Query text was replaced after https://github.com/FirebirdSQL/firebird/commit/26e64e9c08f635d55ac7a111469498b3f0c7fe81
( Cost-based decision between ORDER and SORT plans (#8316) ). ( Cost-based decision between ORDER and SORT plans (#8316) ): 'OPTIMIZE FOR FIRST ROWS' is used for 6.x
Execution plan was replaced with explained. Plans are splitted for versions up to 5.x and 6.x+. Suggested by dimitr, letter 16.11.2024 15:15
Discussed with dimitr, letters 16.11.2024.
Checked on 6.0.0.532; 5.0.2.1567; 4.0.6.3168; 3.0.13.33794. Checked on 6.0.0.532; 5.0.2.1567; 4.0.6.3168; 3.0.13.33794.
""" """
@ -72,8 +71,7 @@ def replace_leading(source, char="."):
@pytest.mark.version('>=3') @pytest.mark.version('>=3')
def test_1(act: Action, capsys): def test_1(act: Action, capsys):
# opt_clause = '' if act.is_version('<5') else 'optimize for first rows' if act.is_version('<6') else '' OPT_CLAUSE = '' if act.is_version('<6') else 'optimize for first rows'
opt_clause = ''
test_sql = f""" test_sql = f"""
select select
@ -84,7 +82,7 @@ def test_1(act: Action, capsys):
t53.id1 = 30 t53.id1 = 30
order by order by
t53.id2 asc t53.id2 asc
{opt_clause} {OPT_CLAUSE}
""" """
with act.db.connect() as con: with act.db.connect() as con:
@ -115,9 +113,9 @@ def test_1(act: Action, capsys):
expected_stdout_6x = """ expected_stdout_6x = """
Select Expression Select Expression
....-> Sort (record length: NN, key length: MM) ....-> Filter
........-> Filter ........-> Table "TABLE_53" as "T53" Access By ID
............-> Table "TABLE_53" as "T53" Access By ID ............-> Index "I_TABLE_53_ID2_ASC" Full Scan
................-> Bitmap ................-> Bitmap
....................-> Index "I_TABLE_53_ID1_ASC" Range Scan (full match) ....................-> Index "I_TABLE_53_ID1_ASC" Range Scan (full match)
""" """