Re: I need Optimizaton of a Query - DISTINCT
Posted by:
Rick James
Date: October 17, 2010 11:15AM
I see that u is not used in the WHERE/GROUP/ORDER clauses. So, let's postpone fetching from u and see if this will make it run faster.
SELECT
fields from both x and u
FROM (
SELECT a.created_by AS userid,
other fields from a, c, s
FROM a, c, s
WHERE all where stuff
ORDER BY ...
LIMIT ...
) x
LEFT? JOIN jos_users AS u ON u.id = x.userid
ORDER BY x.created DESC
LIMIT 20;
Still desire
SHOW CREATE TABLE (for the rest of the tables)
EXPLAIN SELECT
Subject
Views
Written By
Posted
3597
October 13, 2010 08:45PM
1504
October 16, 2010 04:22PM
1663
October 16, 2010 06:29PM
Re: I need Optimizaton of a Query - DISTINCT
1497
October 17, 2010 11:15AM
14297
October 17, 2010 08:36PM
1456
October 17, 2010 08:50PM
1585
October 17, 2010 10:51PM
1458
October 18, 2010 12:35AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.