[firebird-support] Firebird performance vs PostgreSQL

2017-09-28 Thread zilez2...@yahoo.com [firebird-support]
Hello community, 

I am Firebird user for many years, I think I started using Interbase in 2001, 
and after that I use Firebird from version 1.0.
I have a Firebird 2.5 Server in the company where I work, which stores some 
data for the purpose of business analysis.
Since now it is September, many queries works relatively slow, due to a lot of 
data in the database.
From the curiosity, I installed PostgreSQL yesterday on my laptop, migrated 
data from actual Firebird database to Postgresql, and compared time of 
execution on both system. On my great surprise, PostgreSQL was much faster tqan 
Firebird. I don't know nothing about tweak of PostgreSQL database, so I only 
migrated data, nothing else. 
I know that some of my views / queries are not optimized 100% on Firebird, but 
same situation is with PostgreSQL database which was just converted version of 
firebird.
Query which gives me sales by product lines from begining of the year till 
yesterday was working on firebird server 22 seconds, and on PostgreSQL 2 
seconds.

My laptop has SSD disc, but even when i put Firebird database on my laptop, 
query takes 16 seconds in Firebird.

How is it possible that PostgreSQL is so much faster than Firebird?

Regards,

Zoran 

 



Re: [firebird-support] Firebird performance vs PostgreSQL

2017-09-28 Thread 'livius' liviusliv...@poczta.onet.pl [firebird-support]
Hi,

without any sample you talking about nothing..
Show some sample which can be reproduced.
Without this i can say same Firebird is faster then Oracle and what someone can 
say about this – nothing 

regards,
Karol Bieniaszewski

From: zilez2...@yahoo.com [firebird-support] 
Sent: Thursday, September 28, 2017 11:17 AM
To: firebird-support@yahoogroups.com 
Subject: [firebird-support] Firebird performance vs PostgreSQL

  
Hello community, 

I am Firebird user for many years, I think I started using Interbase in 2001, 
and after that I use Firebird from version 1.0.
I have a Firebird 2.5 Server in the company where I work, which stores some 
data for the purpose of business analysis.
Since now it is September, many queries works relatively slow, due to a lot of 
data in the database.
>From the curiosity, I installed PostgreSQL yesterday on my laptop, migrated 
>data from actual Firebird database to Postgresql, and compared time of 
>execution on both system. On my great surprise, PostgreSQL was much faster 
>tqan Firebird. I don't know nothing about tweak of PostgreSQL database, so I 
>only migrated data, nothing else. 
I know that some of my views / queries are not optimized 100% on Firebird, but 
same situation is with PostgreSQL database which was just converted version of 
firebird.
Query which gives me sales by product lines from begining of the year till 
yesterday was working on firebird server 22 seconds, and on PostgreSQL 2 
seconds.

My laptop has SSD disc, but even when i put Firebird database on my laptop, 
query takes 16 seconds in Firebird.

How is it possible that PostgreSQL is so much faster than Firebird?

Regards,

Zoran 








[Non-text portions of this message have been removed]



RE: [firebird-support] Firebird performance vs PostgreSQL

2017-09-28 Thread Ertan Küçükoğlu ertan.kucuko...@1nar.com.tr [firebird-support]
> From: firebird-support@yahoogroups.com 
> [mailto:firebird-support@yahoogroups.com] 
> Sent: Thursday, September 28, 2017 7:35 PM
> To: firebird-support@yahoogroups.com
> Subject: Re: [firebird-support] Firebird performance vs PostgreSQL
>
>  
> Hi,
>
> without any sample you talking about nothing..
> Show some sample which can be reproduced.
> Without this i can say same Firebird is faster then Oracle and what someone 
> can say about this – nothing 
> 
> regards,
> Karol Bieniaszewski

Hello,

I am only providing details for above question. Not trying to say this is 
better or worse or anything.

- SQL statements to create necessary database tables can be found in attached 
*.SQL files.
- Followig link includes "insert into" statements which can be used for loading 
necessary data (around 100.000 records) on both FirebirdSQL and PostgreSQL 
databases.
http://s5.dosya.tc/server5/3dard7/insert_sql_statements.rar.html
- FirebirdSQL database should be created using WIN1254 character set.
- PostgreSQL database should be created as follows
For Linux:
CREATE DATABASE pgtest ENCODING 'UTF-8' LC_COLLATE 'tr_TR.UTF-8' TEMPLATE 
template0;
For Windows: 
CREATE DATABASE pgtest ENCODING 'UTF-8' LC_COLLATE 'tr-TR.UTF-8' TEMPLATE 
template0;
or
CREATE DATABASE pgtest ENCODING 'UTF8' LC_COLLATE 'Turkish_Turkey.1254' 
LC_CTYPE = 'Turkish_Turkey.1254' TEMPLATE template0;

- Query used on both database systems is as follows:
SELECT 
  RAPOR_EK.KAYNAK, 
  RAPOR_EK.SEBEP, 
  COALESCE(DT.IAIK_OG, 0) AS IAIK_OG,
  COALESCE(DT.IAIK_AG, 0) AS IAIK_AG,
  COALESCE(DT.IAIK_TOPLAM, 0) AS IAIK_TOPLAM,
  COALESCE(DT.IADK_OG, 0) AS IADK_OG,
  COALESCE(DT.IADK_AG, 0) AS IADK_AG,
  COALESCE(DT.IADK_TOPLAM, 0) AS IADK_TOPLAM,
  COALESCE(DT.GNLTOPLAM, 0) AS GNLTOPLAM
FROM RAPOR_EK
LEFT JOIN (
  SELECT 
M.KAYNAGAGORE AS KAYNAK, 
M.SEBEBEGORE AS SEBEP, 
(sum(M.ES_IIOG)/(select sum(I.IIOG) from sabitler I where kaynak = 
'CİHANBEYLİ')*60) as IAIK_OG,
(sum(M.ES_IIAG)/(select sum(I.IIAG) from sabitler I where kaynak = 
'CİHANBEYLİ')*60) as IAIK_AG,
((sum(M.ES_IIOG) + sum(M.ES_IIAG)) / ((select sum(I.IIOG) from sabitler I 
where kaynak = 'CİHANBEYLİ')  + (select sum(I.IIAG) from sabitler I where 
kaynak = 'CİHANBEYLİ'))*60) AS IAIK_TOPLAM,
(sum(M.ES_IDOG)/(select sum(I.IDOG) from sabitler I where kaynak = 
'CİHANBEYLİ')*60) as IADK_OG,
(sum(M.ES_IDAG)/(select sum(I.IDAG) from sabitler I where kaynak = 
'CİHANBEYLİ')*60) as IADK_AG,
((sum(M.ES_IDOG) + sum(M.ES_IDAG)) / ((select sum(I.IDOG) from sabitler I 
where kaynak = 'CİHANBEYLİ')  + (select sum(I.IDAG) from sabitler I where 
kaynak = 'CİHANBEYLİ'))*60) AS IADK_TOPLAM,
((sum(M.ES_IIOG) + sum(M.ES_IIAG) + (sum(M.ES_IDOG) + sum(M.ES_IDAG))) / 
((select sum(I.toplam) from sabitler I where kaynak = 'CİHANBEYLİ')*60)) AS 
GNLTOPLAM 
  FROM veri M
  WHERE 
M.ILCE = 'CİHANBEYLİ'
AND M.BILDIRIMEGORE = 'Bildirimsiz'
AND M.SUREYEGORE = 'Uzun'
AND (M.baslangic >= '2015-01-01' AND bitis <= '2015-01-31 23:59:59.999')
  GROUP BY 
M.KAYNAGAGORE,
M.SEBEBEGORE
) DT USING (KAYNAK, SEBEP)
ORDER BY KAYNAK, SEBEP;

- Query plan for both databases can be found in attached *.TXT files.

- My configuration i7-4720HQ cpu, 8GB RAM, Windows 10 64bit, 512GB Sandisk 
Extreme Pro SSD 6GB capability on 6GB connection.
- PostgreSQL version 9.6.4 64bit (installed using Enterprise DB binaries)
- FirebirdSQL version 3.0.1.32609 64bit (official installation) 
- Both database servers have default configuration files. Nothing changed, or 
tweaked.
- I read following figures for above SQL statement execution on a freshly 
created database, freshly loaded data
=> FirebirdSQL using flamerobin.exe to execute (I failed to find a way to 
execute an SQL file with stats on using isql.exe): 1.505 seconds after computer 
reboot, 1.379 seconds for 2nd, 1.381 seconds for 3rd.
=> PostgreSQL using psql.exe to execute: 0.252 seconds after computer reboot, 
0.029 seconds on 2nd, 0.024 seconds on 3rd

You may have additional questions, I try my best to answer within my knowledge.

Regards,
Ertan Küçükoğlu


  --

Field #01: RAPOR_EK.KAYNAK Alias:KAYNAK Type:STRING(20)
Field #02: RAPOR_EK.SEBEP Alias:SEBEP Type:STRING(20)
Field #03: .COALESCE Alias:IAIK_OG Type:NUMERIC(18,2)
Field #04: .COALESCE Alias:IAIK_AG Type:NUMERIC(18,2)
Field #05: .COALESCE Alias:IAIK_TOPLAM Type:NUMERIC(18,2)
Field #06: .COALESCE Alias:IADK_OG Type:NUMERIC(18,2)
Field #07: .COALESCE Alias:IADK_AG Type:NUMERIC(18,2)
Field #08: .COALESCE Alias:IADK_TOPLAM Type:NUMERIC(18,2)
Field #09: .COALESCE Alias:GNLTOPLAM Type:NUMERIC(18,2)
PLAN (DT I INDEX (RDB$PRIMARY2))
PLAN (DT I INDEX (RDB$PRIMARY2))
PLAN (DT I INDEX (RDB$PRIMARY2))

RE: [firebird-support] Firebird performance vs PostgreSQL

2017-09-28 Thread Ertan Küçükoğlu ertan.kucuko...@1nar.com.tr [firebird-support]
> From: mailto:firebird-support@yahoogroups.com 
> [mailto:firebird-support@yahoogroups.com] 
> Sent: Thursday, September 28, 2017 7:35 PM
> To: mailto:firebird-support@yahoogroups.com
> Subject: Re: [firebird-support] Firebird performance vs PostgreSQL
>
> 
> Hi,
>
> without any sample you talking about nothing..
> Show some sample which can be reproduced.
> Without this i can say same Firebird is faster then Oracle and what someone 
> can say about this – nothing 
> 
> regards,
> Karol Bieniaszewski

Hello again,

As forum is not allowing attachments. Necessary files can be found in below 
link:
https://paste.ee/p/1gBQl