Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2007 at 01:06 UTC
Updated:
15 Mar 2010 at 18:18 UTC
Jump to comment: Most recent file
Comments
Comment #1
chx commentedUh, uploaded an earlier attempt, sorry -- not every user has a role though :) Now really the trivial oneliner I wanted.
Comment #2
merlinofchaos commentedPatch applied. Thanks!
Comment #3
FiReaNGeL commentedIf theres an author for every node, I guess that means that there is no use case where the author will be NULL. Then what you want is really a LEFT JOIN; INNER JOIN will cause mysql to check each row for null (to see if it can remove it from the dataset) and can cause some problems with indexes, causing performance degradation.
Comment #4
sunSo, what now? FiReaNG3L's argument seems to make sense...
Comment #5
FiReaNGeL commentedI guess we should compare both EXPLAIN for INNER and LEFT joins on sizable databases
Comment #6
sunComment #7
smk-ka commentedAccording to EXPLAIN's output, it seems like FiReaNG3L is right. I didn't realize (until now) that you can rewrite INNER JOIN as LEFT JOIN t WHERE t.col IS NOT NULL (well, I knew the difference for sure, but I was under the impression INNER JOIN would be some kind of optimized, which seems not to be the case).
Comment #8
FiReaNGeL commentedThese EXPLAIN doesn't prove much as the query is a very simple one, and thus the EXPLAIN are very similar; maybe a 'real world' query with GROUP BY or ORDER BY and some WHERE, such as one generated by views.module, as the patch is for views, would be more appropriate. I still believe that the INNER is useless as there should be no case where a node has no author.
Comment #9
esmerel commentedNo changes are happening with 1.x