mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 21:23:04 +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:
parent
5293f232e6
commit
eb44a7ecdb
@ -150,6 +150,7 @@ void RecordSource::printInversion(thread_db* tdbb, const InversionNode* inversio
|
||||
plan += "Bitmap" + printIndent(++level);
|
||||
|
||||
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;
|
||||
|
||||
@ -161,7 +162,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)
|
||||
|
Loading…
Reference in New Issue
Block a user