Show the query plan.And what abput the second advice about temporary table
istead of multiple or?Regards,Karol Bieniaszewski
null
Hi Karol,
Thank you for your advices.
Adding "simple" indexes on "MAGASIN" and "CAISSE" makes query running more
slowly : 49s with indexes vs 44s without
When the table is indexed on (ANNULE, TYPE_MOUVEMENT, DATEHEURE) they are
not used at all.
Regards,
--
Pierre Yager
On Fri, Nov 15, 2019
Hi
Your problem is that you have (X or X) and (Y or Y)
Firebird cannot use composite index here.
Maybe it can somehow make something like (X1 and Y1) or (X1 and Y2) or … or (X1
and YN) or (X2 and Y1) or (X2 and Y2) …. (XN and YN)
But it will be never optimal.
Create separate indexes for magasin
Hi,
I'm on Windows 7, running Firebird 3.0.4 :
I have this table hosting 1475813 records :
CREATE TABLE JOURNAL_CAISSE (
UID UNIQUEID NOT NULL /* UNIQUEID = CHAR(16) */,
NUMERO INTEGER NOT NULL,
TYPE_MOUVEMENT INTEGER NOT NULL,
DATEHEURE TIMESTAMP DEFA