[PHP-DB] SQL Performance Help

2006-12-27 Thread Tony Grimes
I'm developing a course calendar for a client and I'm running into performance problems with the admin site. For example, when I try to include registration counts in the course list, the page really slows down for large course lists (50 or so): COURSEATTENDEES CAPACITYSEATS LEFT

[PHP-DB] This won't work in MySQL 4.1.10

2006-12-27 Thread Peter Karlsson
but it runs fine in 4.1.20. In .10 I get an error message about unknown column c. I built the sql with help from the comments from the MySQL website manual and have to admit that I don't fully understand it all ;). Is there a way to solve this without upgrading the server? SELECT D

RE: [PHP-DB] SQL Performance Help

2006-12-27 Thread Bastien Koert
1. yes indexes could help, if mysql uses them. The mysql optimiser may or may not use the index for the query depending on the statement...it sounds like you are doing a full table scan on the data 2. there are two schools of thought here: a. run the whole thing as two statements (one outer loo