Durante dei test di confronto di performance tra i database Postgress & MySQL sono venuti fuori dei risultati molto interessanti a favore del primo. I test replicano l’utilizzo di routine dei database, con query di inserzione e gestione di dati. Non vengono utilizzate funzioni, triggers, stored procedures e nessun’altra funzione proprietaria del db.

MySQL è veloce in fase di popolazione dei database a causa di una differente gestione del disco in fase di scrittura. Ma in fase di selezione che è normalmente la piú importante nella storia dell’utilizzo di un db è lento rispetto al rivale Postgres. Questa differenza puó dipendere dal fatto che MySQL deve essere meglio personalizzato per lavorare in un contesto multiprocessore, peró questi risultati (i test sono effettuati in data 01 Novembre 2008) sono molto interessanti.
Riassunto dei test: Database, Macchine utilizzate e Query effettuate (con rispettivi identificativi utilizzati durante i test)
- Database
- [pg] : PostgreSQL 8.3.5
- [ms] : MySQL 5.1
- Hardware
- [blade]: parallel of 3 Blade Dell, each of them with a double Quad-core CPU Intel Xeon E5450, 3Ghz with a 1333MHz BUS and 16 Gb RAM
- [phobos] SUN Workstation with two Opteron 280, 2Ghz+ and 8Gb Ram
- [localhost] cluster of 3 Acer Mini PC Intel Core Duo E2140, 1.6Ghz with 2Gb RAM
- Query
- Creazione di una tabella con 2 coppie di String, di Integer, di Double
- Inserzione di 100.000 righe con elementi random sui campi creati
- Creazione di una tabella con 2 coppie di String, di Integer, di Double
- Inserzione di 100.000 righe con elementi random sui campi creati
- Query di selezione I
- Query di selezione II
Di seguito sono riportati i risultati nel formato:[db@macchina] operazione (tempo trascorso, tempo trascorso in millisecondi)
[pg@phobos] postgres //172.23.4.199:5432/test_db [pg@phobos] TABELLA test_0 CREATA - (00:00:00:156 - 156) [pg@phobos] 1000 IR (00:00:09:781 - 9781) [pg@phobos] 10,000 IR (00:01:34:344 - 94344) [pg@phobos] 100,000 IR (00:15:29:000 - 929000) [pg@phobos] TABELLA test_1 CREATA - (00:15:29:141 - 929141) [pg@phobos] 1000 IR (00:15:38:797 - 938797) [pg@phobos] 10,000 IR (00:17:02:219 - 1022219) [pg@phobos] 100,000 IR (00:30:56:672 - 1856672) [pg@phobos] SI (100000): (00:30:59:281 - 1859281) [pg@phobos] SII (998000): (00:31:39:672 - 1899672) [pg@phobos] Fine degli esperimenti: (00:31:39:672 - 1899672) [ms@phobos] mysql //172.23.4.159:3306/test_db [ms@phobos] TABELLA test_0 CREATA - (00:00:00:078 - 78) [ms@phobos] 1000 IR (00:00:00:625 - 625) [ms@phobos] 10,000 IR (00:00:06:266 - 6266) [ms@phobos] 100,000 IR (00:01:00:547 - 60547) [ms@phobos] TABELLA test_1 CREATA - (00:01:00:828 - 60828) [ms@phobos] 1000 IR (00:01:01:266 - 61266) [ms@phobos] 10,000 IR (00:01:07:016 - 67016) [ms@phobos] 100,000 IR (00:01:59:766 - 119766) [ms@phobos] SI (100000) - (03:25:45:719 - 12345719) [ms@phobos] SII (999000) - (03:26:19:485 - 12379485) [ms@phobos] Fine degli esperimenti - (03:26:19:485 - 12379485) [pg@blade] postgres //172.23.5.217:5432/test_db [pg@blade] TABELLA test_0 CREATA - (00:00:00:078 - 78) [pg@blade] 1000 IR (00:00:01:016 - 1016) [pg@blade] 10,000 IR (00:00:08:344 - 8344) [pg@blade] 100,000 IR (00:01:21:016 - 81016) [pg@blade] TABELLA test_1 CREATA - (00:01:21:063 - 81063) [pg@blade] 1000 IR (00:01:21:859 - 81859) [pg@blade] 10,000 IR (00:01:29:141 - 89141) [pg@blade] 100,000 IR (00:02:41:813 - 161813) [pg@blade] SI (100000) - (00:02:43:844 - 163844) [pg@blade] SII (998000) - (00:03:20:953 - 200953) [pg@blade] Fine degli esperimenti - (00:03:20:953 - 200953) [ms@blade] mysql //172.23.5.217:3306/test_db [ms@blade] TABELLA test_0 CREATA - (00:00:00:000 - 0) [ms@blade] 1000 IR (00:00:00:485 - 485) [ms@blade] 10,000 IR (00:00:04:235 - 4235) [ms@blade] 100,000 IR (00:00:40:719 - 40719) [ms@blade] TABELLA test_1 CREATA - (00:00:40:985 - 40985) [ms@blade] 1000 IR (00:00:41:375 - 41375) [ms@blade] 10,000 IR (00:00:44:969 - 44969) [ms@blade] 100,000 IR (00:01:21:094 - 81094) [ms@blade] SI (100000) - (01:37:28:063 - 5848063) [ms@blade] SII (999000) - (01:38:00:485 - 5880485) [ms@blade] Fine degli esperimenti - (01:38:00:485 - 5880485) [pg@localhost] postgres //localhost:5432/test_db postgres [pg@localhost] TABELLA test_0 CREATA - (00:00:00:125 - 125) [pg@localhost] 1000 IR (00:00:00:844 - 844) [pg@localhost] 10,000 IR (00:00:05:922 - 5922) [pg@localhost] 100,000 IR (00:02:57:453 - 177453) [pg@localhost] TABELLA test_1 CREATA - (00:02:57:547 - 177547) [pg@localhost] 1000 IR (00:02:59:609 - 179609) [pg@localhost] 10,000 IR (00:03:19:984 - 199984) [pg@localhost] 100,000 IR (00:06:34:250 - 394250) [pg@localhost] SI (100000) - (00:06:36:906 - 396906) [pg@localhost] SII (998000) - (00:07:11:594 - 431594) [pg@localhost] Fine degli esperimenti - (00:07:11:594 - 431594) [pg@Phobos@localhost] postgres //localhost:5432/test_db [pg@Phobos@localhost] TABELLA test_0 CREATA - (00:00:00:220 - 221) [pg@Phobos@localhost] 1000 IR (00:00:09:581 - 9581) [pg@Phobos@localhost] 10,000 IR (00:01:32:402 - 92402) [pg@Phobos@localhost] 100,000 IR (00:15:17:453 - 917453) [pg@Phobos@localhost] TABELLA test_1 CREATA - (00:15:17:698 - 917699) [pg@Phobos@localhost] 1000 IR (00:15:26:859 - 926859) [pg@Phobos@localhost] 10,000 IR (00:16:50:221 - 1010222) [pg@Phobos@localhost] 100,000 IR (00:30:38:331 - 1838332) [pg@Phobos@localhost] SI (100000) - (00:30:40:377 - 1840377) [pg@Phobos@localhost] SII (998000) - (00:31:02:162 - 1862163) [pg@Phobos@localhost] Fine degli esperimenti - (00:31:02:163 - 1862163) [ms@phobos@localhost] mysql //162.14.19.139:3306/test_db pdb [ms@phobos@localhost] TABELLA test_0 CREATA - (00:00:00:073 - 74) [ms@phobos@localhost] 1000 IR (00:00:00:534 - 534) [ms@phobos@localhost] 10,000 IR (00:00:03:188 - 3188) [ms@phobos@localhost] 100,000 IR (00:00:18:275 - 18275) [ms@phobos@localhost] TABELLA test_1 CREATA - (00:00:18:881 - 18881) [ms@phobos@localhost] 1000 IR (00:00:18:998 - 18998) [ms@phobos@localhost] 10,000 IR (00:00:20:197 - 20197) [ms@phobos@localhost] 100,000 IR (00:00:28:169 - 28169) [ms@phobos@localhost] SI (100000) - (02:54:51:226 - 10491226) [ms@phobos@localhost] SII (999000) - (02:55:09:629 - 10509629) [ms@phobos@localhost] Fine degli esperimenti - (02:55:09:630 - 10509630)
Filed under: Bulletin

