RE: [PHP] DB speed
Well obviously - cos MySQL rocks!!, but seriously I also did some tests and got variable results from different db's - even got an odbc connection to access to run faster than mysql at one stage!! - something tells me there are other factors contributing.. Cheers Simon -Original Message- From: Uros Gruber [mailto:[EMAIL PROTECTED]] Sent: 10 October 2002 14:17 To: [EMAIL PROTECTED] Subject: [PHP] DB speed Hi! I'm making some testing over DB.php (PEAR) And i wan't to know if this is normal. I've made some script where I connect do SQL server and execute one simple (1row) query. I use pgsql and mysql. tables and indexes are same for both servers. So test table is identical Whe i execute those script i get some timing results PGSQL Total time: 0.0576 Execution time: 0.0185 MySQL Total time: 0.0086 Execution time: 0.0028 Time is in seconds. My machine is PIII 333 MHz with 128MB RAM. I table is only 3 rows of data. I want to know why is sucsh diference. Both servers runing with socket connections and using connnect (non-persistant) -- tia, Uros mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] DB speed
I think i read something a while ago, about mysql being faster, having less features, but postgres being a little slower but able to handle LARGE databases better than mysql. I could be wrong, so dont take my word for it. At the end of the day they are both good db's. On Thu, 2002-10-10 at 09:02, Simon Taylor wrote: Well obviously - cos MySQL rocks!!, but seriously I also did some tests and got variable results from different db's - even got an odbc connection to access to run faster than mysql at one stage!! - something tells me there are other factors contributing.. Cheers Simon -Original Message- From: Uros Gruber [mailto:[EMAIL PROTECTED]] Sent: 10 October 2002 14:17 To: [EMAIL PROTECTED] Subject: [PHP] DB speed Hi! I'm making some testing over DB.php (PEAR) And i wan't to know if this is normal. I've made some script where I connect do SQL server and execute one simple (1row) query. I use pgsql and mysql. tables and indexes are same for both servers. So test table is identical Whe i execute those script i get some timing results PGSQL Total time: 0.0576 Execution time: 0.0185 MySQL Total time: 0.0086 Execution time: 0.0028 Time is in seconds. My machine is PIII 333 MHz with 128MB RAM. I table is only 3 rows of data. I want to know why is sucsh diference. Both servers runing with socket connections and using connnect (non-persistant) -- tia, Uros mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB speed
Simon Taylor wrote: Well obviously - cos MySQL rocks!!, but seriously I also did some tests and got variable results from different db's - even got an odbc connection to access to run faster than mysql at one stage!! - something tells me there are other factors contributing.. -Original Message- From: Uros Gruber [mailto:[EMAIL PROTECTED]] Sent: 10 October 2002 14:17 To: [EMAIL PROTECTED] Subject: [PHP] DB speed And i wan't to know if this is normal. PGSQL Total time: 0.0576 Execution time: 0.0185 MySQL Total time: 0.0086 Execution time: 0.0028 If the MySQL table is standard (not INNODB) then there are no transactions, thus is faster. I have not tried tests on these two databases in particular, but some (e.g. Oracle), cache results so a second time of asking can be very much quicker than the first. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB speed
For SIMPLE SIMPLE selects and inserts, MySQL will probably remain faster. If you are doing a very simple web set up where you are mostly inserting and spitting out single table information, MySQL will be the way to go. Anything else, I would recommend PostgreSQL. It's got FAR superior features and anytime you start very complex queries ( like JOINS and multi-table aggregate functions, etc ) postgres will blow MySQL out of the water. They are both nice, just for different purposes. MySQL = simple, PostgreSQL = anything else. Also, you can run EXPLAIN query on PostgreSQL to find out exactly what is happening when you do a query and if it's using an index properly or not. regards, dan tuxen wrote: I think i read something a while ago, about mysql being faster, having less features, but postgres being a little slower but able to handle LARGE databases better than mysql. I could be wrong, so dont take my word for it. At the end of the day they are both good db's. On Thu, 2002-10-10 at 09:02, Simon Taylor wrote: Well obviously - cos MySQL rocks!!, but seriously I also did some tests and got variable results from different db's - even got an odbc connection to access to run faster than mysql at one stage!! - something tells me there are other factors contributing.. Cheers Simon -Original Message- From: Uros Gruber [mailto:[EMAIL PROTECTED]] Sent: 10 October 2002 14:17 To: [EMAIL PROTECTED] Subject: [PHP] DB speed Hi! I'm making some testing over DB.php (PEAR) And i wan't to know if this is normal. I've made some script where I connect do SQL server and execute one simple (1row) query. I use pgsql and mysql. tables and indexes are same for both servers. So test table is identical Whe i execute those script i get some timing results PGSQL Total time: 0.0576 Execution time: 0.0185 MySQL Total time: 0.0086 Execution time: 0.0028 Time is in seconds. My machine is PIII 333 MHz with 128MB RAM. I table is only 3 rows of data. I want to know why is sucsh diference. Both servers runing with socket connections and using connnect (non-persistant) -- tia, Uros mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] DB speed
Would access be a lot slower than these then for a query with multiple tables and other such things? Is there a resource on the net regarding this? -Original Message- From: Dan Ostrowski [mailto:[EMAIL PROTECTED]] Sent: 10 October 2002 18:43 To: tuxen Cc: [EMAIL PROTECTED] Subject: Re: [PHP] DB speed For SIMPLE SIMPLE selects and inserts, MySQL will probably remain faster. If you are doing a very simple web set up where you are mostly inserting and spitting out single table information, MySQL will be the way to go. Anything else, I would recommend PostgreSQL. It's got FAR superior features and anytime you start very complex queries ( like JOINS and multi-table aggregate functions, etc ) postgres will blow MySQL out of the water. They are both nice, just for different purposes. MySQL = simple, PostgreSQL = anything else. Also, you can run EXPLAIN query on PostgreSQL to find out exactly what is happening when you do a query and if it's using an index properly or not. regards, dan tuxen wrote: I think i read something a while ago, about mysql being faster, having less features, but postgres being a little slower but able to handle LARGE databases better than mysql. I could be wrong, so dont take my word for it. At the end of the day they are both good db's. On Thu, 2002-10-10 at 09:02, Simon Taylor wrote: Well obviously - cos MySQL rocks!!, but seriously I also did some tests and got variable results from different db's - even got an odbc connection to access to run faster than mysql at one stage!! - something tells me there are other factors contributing.. Cheers Simon -Original Message- From: Uros Gruber [mailto:[EMAIL PROTECTED]] Sent: 10 October 2002 14:17 To: [EMAIL PROTECTED] Subject: [PHP] DB speed Hi! I'm making some testing over DB.php (PEAR) And i wan't to know if this is normal. I've made some script where I connect do SQL server and execute one simple (1row) query. I use pgsql and mysql. tables and indexes are same for both servers. So test table is identical Whe i execute those script i get some timing results PGSQL Total time: 0.0576 Execution time: 0.0185 MySQL Total time: 0.0086 Execution time: 0.0028 Time is in seconds. My machine is PIII 333 MHz with 128MB RAM. I table is only 3 rows of data. I want to know why is sucsh diference. Both servers runing with socket connections and using connnect (non-persistant) -- tia, Uros mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB speed
From my experience, I found this: Selecting 1000 records from 2 tables using a join, 10secs and up. Selecting 1000 records for table 1, all records from table 2, then using php to figure out which rows from table 2 belong to table 1 and building my own combined array, less than a second. Would access be a lot slower than these then for a query with multiple tables and other such things? Is there a resource on the net regarding this? -Original Message- From: Dan Ostrowski [mailto:[EMAIL PROTECTED]] Sent: 10 October 2002 18:43 To: tuxen Cc: [EMAIL PROTECTED] Subject: Re: [PHP] DB speed For SIMPLE SIMPLE selects and inserts, MySQL will probably remain faster. If you are doing a very simple web set up where you are mostly inserting and spitting out single table information, MySQL will be the way to go. Anything else, I would recommend PostgreSQL. It's got FAR superior features and anytime you start very complex queries ( like JOINS and multi-table aggregate functions, etc ) postgres will blow MySQL out of the water. They are both nice, just for different purposes. MySQL = simple, PostgreSQL = anything else. Also, you can run EXPLAIN query on PostgreSQL to find out exactly what is happening when you do a query and if it's using an index properly or not. regards, dan tuxen wrote: I think i read something a while ago, about mysql being faster, having less features, but postgres being a little slower but able to handle LARGE databases better than mysql. I could be wrong, so dont take my word for it. At the end of the day they are both good db's. On Thu, 2002-10-10 at 09:02, Simon Taylor wrote: Well obviously - cos MySQL rocks!!, but seriously I also did some tests and got variable results from different db's - even got an odbc connection to access to run faster than mysql at one stage!! - something tells me there are other factors contributing.. Cheers Simon -Original Message- From: Uros Gruber [mailto:[EMAIL PROTECTED]] Sent: 10 October 2002 14:17 To: [EMAIL PROTECTED] Subject: [PHP] DB speed Hi! I'm making some testing over DB.php (PEAR) And i wan't to know if this is normal. I've made some script where I connect do SQL server and execute one simple (1row) query. I use pgsql and mysql. tables and indexes are same for both servers. So test table is identical Whe i execute those script i get some timing results PGSQL Total time: 0.0576 Execution time: 0.0185 MySQL Total time: 0.0086 Execution time: 0.0028 Time is in seconds. My machine is PIII 333 MHz with 128MB RAM. I table is only 3 rows of data. I want to know why is sucsh diference. Both servers runing with socket connections and using connnect (non-persistant) -- tia, Uros mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB speed
From my experience, I found this: Selecting 1000 records from 2 tables using a join, 10secs and up. I'd say you have a problem in your database / table configuration, i.e. indexes. There's no way a join between two tables that are properly indexed should take 10 seconds for only 1000 rows. Selecting 1000 records for table 1, all records from table 2, then using php to figure out which rows from table 2 belong to table 1 and building my own combined array, less than a second. You're using a lot more memory on the server, though, by building up a huge array and recordsets. But, RAM is cheap... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB speed
Yes persistant connections to pg make a LOT of difference and are recommended.. I have never had overhead problems using them eaither. I am terribly sorry i didn't mention this before. Just make sure you have proper indexes and you should be good to go. regards, dan Uros Gruber wrote: Hi! I make some more test for this. When i enable pconect (persistant) the result amazed me. PGSQL Total time: 0.0070 Execution time: 0.0034 MySQL Total time: 0.0072 Execution time: 0.0027 Now PGSQL is as fast as mysql or maybe a lile slower. So is this normal that non-persistant is so much overhead for pg. Is there any tools to check this. Or is some kind of a bug in php. I use 4.2.3. And pg is 7.2.1. Can somebody make some test. I can send script what i've run. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php