mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 20:03:02 +01:00
Improvement #8104 : Inefficient evaluation of expressions like rdb$db_key <= ? after mass delete
This commit is contained in:
parent
aa3cafb420
commit
1e5385637d
@ -146,14 +146,10 @@ bool FullTableScan::internalGetRecord(thread_db* tdbb) const
|
||||
return false;
|
||||
}
|
||||
|
||||
if (VIO_next_record(tdbb, rpb, request->req_transaction, request->req_pool, DPM_next_all))
|
||||
{
|
||||
if (impure->irsb_upper.isValid() && rpb->rpb_number > impure->irsb_upper)
|
||||
{
|
||||
rpb->rpb_number.setValid(false);
|
||||
return false;
|
||||
}
|
||||
const RecordNumber* upper = impure->irsb_upper.isValid() ? &impure->irsb_upper : nullptr;
|
||||
|
||||
if (VIO_next_record(tdbb, rpb, request->req_transaction, request->req_pool, DPM_next_all, upper))
|
||||
{
|
||||
rpb->rpb_number.setValid(true);
|
||||
return true;
|
||||
}
|
||||
|
@ -3759,7 +3759,8 @@ bool VIO_next_record(thread_db* tdbb,
|
||||
record_param* rpb,
|
||||
jrd_tra* transaction,
|
||||
MemoryPool* pool,
|
||||
FindNextRecordScope scope)
|
||||
FindNextRecordScope scope,
|
||||
const RecordNumber* upper)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -3794,9 +3795,14 @@ bool VIO_next_record(thread_db* tdbb,
|
||||
rpb->rpb_f_page, rpb->rpb_f_line);
|
||||
#endif
|
||||
|
||||
do {
|
||||
do
|
||||
{
|
||||
if (!DPM_next(tdbb, rpb, lock_type, scope))
|
||||
return false;
|
||||
|
||||
if (upper && rpb->rpb_number > *upper)
|
||||
{
|
||||
CCH_RELEASE(tdbb, &rpb->getWindow(tdbb));
|
||||
return false;
|
||||
}
|
||||
} while (!VIO_chase_record_version(tdbb, rpb, transaction, pool, false, false));
|
||||
|
@ -67,7 +67,8 @@ bool VIO_get_current(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*,
|
||||
void VIO_init(Jrd::thread_db*);
|
||||
Jrd::WriteLockResult VIO_writelock(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*);
|
||||
bool VIO_modify(Jrd::thread_db*, Jrd::record_param*, Jrd::record_param*, Jrd::jrd_tra*);
|
||||
bool VIO_next_record(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*, MemoryPool*, Jrd::FindNextRecordScope);
|
||||
bool VIO_next_record(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*, MemoryPool*,
|
||||
Jrd::FindNextRecordScope, const RecordNumber* = nullptr);
|
||||
Jrd::Record* VIO_record(Jrd::thread_db*, Jrd::record_param*, const Jrd::Format*, MemoryPool*);
|
||||
bool VIO_refetch_record(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*, bool, bool);
|
||||
void VIO_store(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*);
|
||||
|
Loading…
Reference in New Issue
Block a user