If you look at zc v1.5.8 (same file) these queries all use inner join or left join which is are more efficient. Queries from 1.5.7 you posted here are going through all database before applying Where clause.
It looks to me that new queries from v1.5.8 could be easily uses in v1.5.7 too.
You could although use STRAIGHT_JOIN and place smaller table first and most restrict condition first. With STRAIGHT_JOIN order is important.
For example:
PHP Code:
$productsFeatured = $db->Execute("SELECT p.products_id,
f.featured_id, f.expires_date, f.featured_date_available, f.status
FROM " . TABLE_FEATURED . " f STRAIGHT_JOIN " . TABLE_PRODUCTS . " p
ON p.products_id = f.products_id
WHERE f.products_id = " . (int)$_GET['products_filter']);
This query will go through left table first, feature table which is far smaller than you product table. This is done like this for 'big data' as I know but with your table size standard INNER JOIN like used in zc v1.5.8 should be good too.
Bookmarks