8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 15:23:03 +01:00

Fix #8290: 'Unique scan' is incorrectly reported in the explained plan for unique index and IS NULL predicate

This commit is contained in:
Dmitry Yemanov 2024-10-24 12:43:01 +03:00
parent 7886c9cd93
commit a1167b4431

View File

@ -203,6 +203,7 @@ void RecordSource::printInversion(thread_db* tdbb, const InversionNode* inversio
}
const index_desc& idx = retrieval->irb_desc;
const bool primaryIdx = (idx.idx_flags & idx_primary);
const bool uniqueIdx = (idx.idx_flags & idx_unique);
const USHORT segCount = idx.idx_count;
@ -214,7 +215,13 @@ void RecordSource::printInversion(thread_db* tdbb, const InversionNode* inversio
const bool fullscan = (maxSegs == 0);
const bool list = (retrieval->irb_list != nullptr);
const bool unique = !list && uniqueIdx && equality && (minSegs == segCount);
bool unique = false;
if (!list && equality && minSegs == segCount)
{
unique = (retrieval->irb_generic & irb_ignore_null_value_key) ?
uniqueIdx : primaryIdx;
}
string bounds;
if (!unique && !fullscan)