Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
8 May 2008 at 22:01 UTC
Updated:
23 May 2008 at 19:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
merlinofchaos commentedQuick code style comments: unary operator ! should not have space between it and the variable it operates on. $quetab should probably be an actual word (I'm less strict about that than Drupal default style, though) but I'd be just as happy with $table for the variable.
We definitely have to run it through adjust_join or it won't match.
If the join is run through adjust_join you *may* not need to check relationship which means we might be able to do something slick with array_filter? It may be faster.
Comment #2
bjaspan commentedThe patch now handles adjust_join() correctly (I think :-)). I made a simple test case: Content type test1 has three single value fields:
- field_field1: text
- field_field2: integer
- field_noderef: noderef to 'story'
Without the optimization, we get the query:
With the optimization, we get the query:
I also fixed the style comments.
This patch has 11 lines of code (including four "}") and 28 lines of comments. ;-)
I just realized a problem. The optimization is working, but the selected fields are getting the wrong AS name: they are being based on the existed queued table name, not the optimized-away joined table name. This needs to be fixed.
Comment #3
bjaspan commentedDiscussion with Earl on IRC concludes that the field renaming issue I mentioned above is not a problem; Views does not guarantee that fields names will be consistent and provides other mechanisms for accessing the data reliably. Therefore, CNR.
Comment #4
merlinofchaos commentedCommitted!
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.