Open kristinriebe opened 11 years ago
partially fixed in ca2a2623729be642a128cf4dfd1dd9849fc60926
however a mess remains with ANDs and ORs in WHERE conditions. The whole implicit JOIN part needs rethinking on how to handle compilcated cases of ANDs and ORs
i'm not feeling comfortable here...
I have following query: select p.fofTreeId, p.treeSnapnum, p.x,p.y,p.z from MDR1.FOFMtree as m, MDR1.FOFMtree as p where m.fofTreeId < 100000000+5 and p.fofTreeId between m.fofTreeId and m.mainLeafId
It could be much faster, if first m.fofTreeId < 100000000+5 is used to get a smaller subset of the table before joining. (I tried to enforce this with a subquery, but got a parse error). This is what PaQu is trying, which is very inefficient:
CALL paquExec('SELECT p.fofTreeId AS
p.fofTreeId
,p.treeSnapnum ASp.treeSnapnum
,p.x ASp.x
,p.y ASp.y
,p.z ASp.z
FROM MDR1.FOFMtree ASm
JOIN MDR1.FOFMtree ASp
ORDER BY NULL ', 'aggregation_tmp_89562445'); CALL paquExec('SELECT p.p.fofTreeId
ASp.fofTreeId
,p.p.treeSnapnum
ASp.treeSnapnum
,p.p.x
ASp.x
,p.p.y
ASp.y
,p.p.z
ASp.z
FROM MDR1.FOFMtree ASm
JOIN MDR1.FOFMtree ASp
JOIN ( SELECTp.fofTreeId
,p.treeSnapnum
,p.x
,p.y
,p.z
FROMaggregation_tmp_89562445
) ASp
WHERE ( ( m.fofTreeId < 100000000 + 5 ) and (p
.p.fofTreeId
between m.fofTreeId and m.mainLeafId ) ) ', 'aggregation_tmp_75999751'); CALL paquDropTmp('aggregation_tmp_89562445'); USE spider_tmp_shard; SET @i=0; CREATE TABLE multidark_user_kristin./*@GEN_RES_TABLE_HERE*/
ENGINE=MyISAM SELECT @i:=@i+1 ASrow_id
,distinct_res_table
.* FROM ( SELECT DISTINCTp.fofTreeId
,p.treeSnapnum
,p.x
,p.y
,p.z
FROMaggregation_tmp_75999751
) asdistinct_res_table
; CALL paquDropTmp('aggregation_tmp_75999751');