Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 May 2006 at 15:10 UTC
Updated:
8 Jul 2006 at 00:02 UTC
I had attentioned that views always use LEFT JOIN to joining the tables.
but there is a INNER JOIN which runs more quickly . so I need a INNER JOIN support.
example:.
#1:SELECT node.nid, node_area.code AS node_area_code, node.title AS node_title, node.changed AS node_changed FROM node node LEFT JOIN node_area node_area ON node.nid = node_area.nid WHERE (node.type IN ('node_area')) ORDER BY node_area.code ASC LIMIT 0, 30
THE query use 3513.09ms .
#2: some as #1,but replace LEFT JOIN to INNER JOIN
SELECT node.nid, node_area.code AS node_area_code, node.title AS node_title, node.changed AS node_changed FROM node node INNER JOIN node_area node_area ON node.nid = node_area.nid WHERE (node.type IN ('node_area')) ORDER BY node_area.code ASC LIMIT 0, 30
THE #2 query only use 33.87 ms about 100 plus.
An INNER JOIN returns only those rows from the left table having a matching row in the right table based on the join criteria. and that is all what i need .
sometimes I do not need left join.
Comments
Comment #1
merlinofchaos commentedWhile the UI cannot tell it to use an inner join (the UI doesn't even really understand the concept of a join) the data itself can use 'type' => 'inner' in the joininfo.
Comment #2
(not verified) commented