[PHP-DB] Group by

2009-12-09 Thread Philip Thompson
Hi. In a mysql query, it is recommended that GROUP BY fields be indexed? Using EXPLAIN on one of my queries, I noticed no change between having indexed by GROUP BY field and not indexing it. Any thoughts would be appreciated. In this example, should `history_field` be indexed...? SELECT

Re: [PHP-DB] Group by

2009-12-09 Thread Julio Araya
On Wed, Dec 9, 2009 at 12:52 PM, Philip Thompson philthath...@gmail.com wrote: Hi. In a mysql query, it is recommended that GROUP BY fields be indexed? Using EXPLAIN on one of my queries, I noticed no change between having indexed by GROUP BY field and not indexing it. Any thoughts would be

Re: [PHP-DB] Group by

2009-12-09 Thread Juan Pablo Ramirez
Hi i recommend always use indexes when programming. developers tend not to.. and when the databases grows it's difficult to modify or make them modify the code. El mié, 09-12-2009 a las 14:22 -0300, Julio Araya escribió: On Wed, Dec 9, 2009 at 12:52 PM, Philip Thompson philthath...@gmail.com

Re: [PHP-DB] Group by

2009-12-09 Thread Barry Stear
Also you may not see a difference because your not even using 'History_field' anywhere in your SELECT statement. I am a little surprised that you didn't receive a error. On Wed, Dec 9, 2009 at 9:31 AM, Juan Pablo Ramirez ramirez.juanpa...@gmail.com wrote: Hi i recommend always use indexes when

[PHP-DB] Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?

2009-12-09 Thread Sara Leavitt
Hi, We are about to convert all of our queries using mysql_pconnect to prepared statements using PDO database connections. It will take some time to convert the hundreds of SQL statements so the plan is to do it in phases. Is is bad idea to have both a mysql_pconnect and a PDO connection

Re: [PHP-DB] Group by

2009-12-09 Thread h...@deweywilliams.com
The only SELECT is on MAX('timestamp'). There is really nothing to Group BY in this query. Dewey Philip Thompson wrote: Hi. In a mysql query, it is recommended that GROUP BY fields be indexed? Using EXPLAIN on one of my queries, I noticed no change between having indexed by GROUP BY field

[PHP-DB] Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?

2009-12-09 Thread Sara Leavitt
Hi, We are about to convert all of our queries using mysql_pconnect to prepared statements using PDO database connections. It will take some time to convert the hundreds of SQL statements so the plan is to do it in phases. Is it a bad idea to have both a mysql_pconnect and a PDO connection

Re: [PHP-DB] Group by

2009-12-09 Thread Philip Thompson
On Dec 9, 2009, at 12:58 PM, h...@deweywilliams.com wrote: The only SELECT is on MAX('timestamp'). There is really nothing to Group BY in this query. Dewey Philip Thompson wrote: Hi. In a mysql query, it is recommended that GROUP BY fields be indexed? Using EXPLAIN on one of my

Re: [PHP-DB] Group by

2009-12-09 Thread Chris
Philip Thompson wrote: On Dec 9, 2009, at 12:58 PM, h...@deweywilliams.com wrote: The only SELECT is on MAX('timestamp'). There is really nothing to Group BY in this query. Dewey Philip Thompson wrote: Hi. In a mysql query, it is recommended that GROUP BY fields be indexed? Using

Re: [PHP-DB] Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?

2009-12-09 Thread Chris
Sara Leavitt wrote: Hi, We are about to convert all of our queries using mysql_pconnect to prepared statements using PDO database connections. It will take some time to convert the hundreds of SQL statements so the plan is to do it in phases. Is it a bad idea to have both a mysql_pconnect and

Re: [PHP-DB] Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?

2009-12-09 Thread Andy Shellam (Mailing Lists)
As long as you test it (hopefully using some sort of automated tests) you should be right. Since you're using persistent connections (make sure you set pdo to do the same), I don't think you're really doubling the number of connections. Yeah, I think PDO uses the underlying mysql/pgsql