Ryan, You might well find that the 5 separate counts are quicker than the join approach. Mysql is pretty efficient at counts on indexed columns from a single table. My instincts suggest that the four table join you are proposing could be slower than the 5 separate counts, especially if the tables have thousands of rows.
As long as you use the same database connection, there's shouldn't be much extra network overhead either. I may be wrong, but I suspect you're worrying unnecessarily, unless the database server is connected to the web server via a particularly slow network. Make sure you've got the right indexes on all of the tables though (ie put an index on each table that matches the where clause against that table). All the best, Andy > -----Original Message----- > From: Ryan A [mailto:[EMAIL PROTECTED] > Sent: 15 September 2003 13:31 > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: Re: Blasted #$%$^$^ host has v3.23 when i need UNION > > > > Hey Andy, > True, but thats using 5 selects instead of just one, and since we > are expecting quite a bit of traffic to the site that can add up > pretty fast, expecially since we cant afford to have a dedicated > server but are on a shared hosting package. > > If we have no other alternative we will be going with the 5 > selects but since there seems to be a "join" alternative was > hoping someone could help me out. > > Thanks anyway. > Cheers, > -Ryan > > > Ryan, > > > > If this query worked, it would return you 5 rows, one for each separate > > count. > > > > If you execute 5 separate counts in PHP, you'll get 5 separate > values with > > the same numbers as above. > > > > Not radically different? > > > > Andy > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]