Subject Re: Firebird performance vs PostgreSQL
Author
Hi,

database structures at:

https://paste.ee/p/qjTwz

Aprox size of tables

Artikli = 227.000 rows
faktur = 85.000 rows
izlaz = 292.000 rows
Partneri = 13400 rows
Kurs = 180 rows
Vrste = 560 rows
Porezi = 6 rows
Faktype = 30 rows
Magacin = 60 rows

Query

SELECT
        V_TXT1,
        sum(I_KOL) AS KOMADA,
        sum(I_NCENA*I_KOL/KURS_EURA) AS NABAVNA_VREDNOST ,
        Sum(I_CENA*I_KOL*cast((1-(F_KASP/100.00)) AS DOUBLE PRECISION)*CAST(((100-I_RAB)/100) AS DOUBLE PRECISION)/KURS_EURA) AS VRED_MP
    FROM glavni_upit
    WHERE G_TIP='V' AND (F_DAT>=:POC AND F_DAT<=:KRAJ) AND I_CENA>0
    GROUP BY V_TXT1

Firebird 2.5.6 execution time = 16 seconds
PostgreSQL latest 9 builds = 2 seconds

on the same machine