Re: [firebird-support] How to index this table

2019-11-18 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Show the query plan.And what abput the second advice about temporary table istead of multiple or?Regards,Karol Bieniaszewski null

Re: [firebird-support] How to index this table

2019-11-18 Thread 'Pierre Y.' pierr...@gmail.com [firebird-support]
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

ODP: [firebird-support] How to index this table

2019-11-15 Thread Karol Bieniaszewski liviusliv...@poczta.onet.pl [firebird-support]
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

[firebird-support] How to index this table

2019-11-15 Thread 'Pierre Y.' pierr...@gmail.com [firebird-support]
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