Subject Re: [firebird-support] Firebird Indexing problem
why do you need to slow down query by index?
If you go throught whole table and only some sub percent (REPL) is not looked for?
consider something like this
VALUE=’RX’ 100 records
VALUE=’YY’ 100 records
VALUE=’XX’ 100 records
VALUE=’AA’ 100 records
VALUE=’REPL’ 100 records
then this is cheaper to scan table (500 records) then use 400 indexed reads
Karol Bieniaszewski
Sent: Thursday, October 22, 2015 1:13 PM
Subject: [firebird-support] Firebird Indexing problem

Hi guys,

I have a problem with indexing in FB. Heres the query


select rep$, tablica_ime, client_number, time_stamp, sql_type, sql_query, usr

from rep$log

where usr <> 'REPL' and not exists

(select rep$ from rep$trans where rep$trans.replicated_pk = rep$


Statistics show that rep$log has all non-indexed reads even though I've created an index for the usr field.

What's more interesting is that if I change this line

where usr <> 'REPL' and not exists


where usr = 'SYSDBA' and not exists

all tha reads are indexed. So the problem is in the <> operation. How can I have indexed reads and keep the <> operation?

Thank you in advance guys.