FirebirdSQL / firebird-qa

Python tools used for Firebird QA
MIT License
3 stars 6 forks source link

Updated tests/bugs/gh_3810_test.py #19

Closed ant-zuev closed 1 year ago

ant-zuev commented 1 year ago

Remove an index tmp_tbl1_fld2 from the test. The index does not refer to the fix, while the optimizer may produce a plan different from the expected one.

pavel-zotov commented 1 year ago

I have to object to that. According to this: https://github.com/FirebirdSQL/firebird/issues/3810#issuecomment-826221325 (" the other index (tmp_tbl1_fld2) should not be considered") -- the fix exactly referred to the case when this extra index exists in the database. So, if we remove it then optimizer will just have no choose and plan always will be the same.

dyemanov commented 1 year ago

Pavel, the real fix for this issue has been committed by Vlad after my comment. And it improves lookup inside a compound index. So it's OK to test fetches with and without fix, but only for the compound index. This makes the second (single-segment) index redundant for this test.

pavel-zotov commented 1 year ago

OK, i will change this test.

But i have one more Q. Does it make sense to remove this index and add another one, compound for the same columns but DESCENDING, to check that when it is used then we have same fetches ?

pavel-zotov commented 1 year ago

Test updated. Issue can be closed.

dyemanov commented 1 year ago

OK, i will change this test.

But i have one more Q. Does it make sense to remove this index and add another one, compound for the same columns but DESCENDING, to check that when it is used then we have same fetches ?

Feel free. AFAIR, descending indices don't have this bug, so both could be tested to deliver the same performance. However, size of both indices could be different and thus number of fetches could also be different.