Subject | ODP: [firebird-support] Query optimization on FB3 |
---|---|
Author | Karol Bieniaszewski |
Post date | 2019-02-13T18:42:05Z |
Hi.
There are 2 common ways
- Create global temporary table
Do INSERT INTO T(DSTART, DEND) SELECT …
and then do simple join with this table - Use derived table e.g.
SELECT
DATENLOGGING.* …
FROM
(SELECT D.DSTART, D.DEND FROM TABLED) X
LEFT JOIN DATENLOGGING ON DATENLOGGING.DATUMZEIT>=X. DSTART AND DATENLOGGING.DATUMZEIT<=X.DEND
WHERE
DATENLOGGING.KEY IS NOT NULL /* do hidden inner join by providing some not nullable field check */
Regards,
Karol Bieniaszewski