Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Condition not applied correctly #35

Open
kristinriebe opened this issue Dec 12, 2014 · 0 comments
Open

Condition not applied correctly #35

kristinriebe opened this issue Dec 12, 2014 · 0 comments

Comments

@kristinriebe
Copy link

The condition sprng_dbl(123) < 0.01 should be applied at the end, not just for the first subquery.
This is probably related to some of the other issues.
Maybe it's also somethign that PaQu cannot know and must be stated more explicitely using a nested subquery. In any case it shouldn't just assign the sprng-condition to the very first subquery it does (this will return wrong results).

Query

SELECT f.fofId, f.x,f.y,f.z,f.size, p.x,p.y,p.z 
FROM Bolshoi.FOF f, Bolshoi.Particles416 p 
WHERE f.fofId=416000400000 
AND SQRT( POWER(p.x-f.x,2) + POWER(p.y-f.y,2) + POWER(p.z-f.z,2) ) <= f.size 
AND sprng_dbl(123) < 0.01

Query plan

-- CALL paquExec('SELECT `f`.`fofId` AS `f.fofId`,`f`.`x` AS `f.x`,`f`.`y` AS `f.y`,`f`.`z` AS `f.z`,`f`.`size` AS `f.size` FROM Bolshoi.FOF AS `f` WHERE ( `f`.`fofId` = 416000400000 ) AND ( sprng_dbl( 123 ) < 0.01 ) ', 'aggregation_tmp_28695038')
-- CALL paquExec('SELECT `p`.`x` AS `p.x`,`p`.`y` AS `p.y`,`p`.`z` AS `p.z`,`f`.`f.fofId` AS `f.fofId`,`f`.`f.x` AS `f.x`,`f`.`f.y` AS `f.y`,`f`.`f.z` AS `f.z`,`f`.`f.size` AS `f.size` FROM Bolshoi.Particles416 AS `p` JOIN ( SELECT `f.fofId`,`f.x`,`f.y`,`f.z`,`f.size` FROM `aggregation_tmp_28695038` ) AS `f` WHERE ( SQRT( POWER( `p`.`x` - `f`.`f.x`, 2 ) + POWER( `p`.`y` - `f`.`f.y`, 2 ) + POWER( `p`.`z` - `f`.`f.z`, 2 ) ) <= `f`.`f.size` ) ', 'aggregation_tmp_112926')-- CALL paquDropTmp('aggregation_tmp_28695038')
-- USE spider_tmp_shard
-- SET @i=0
-- CREATE TABLE cosmosim_user_kristin.`2014-12-12-13-29-50-1907` ENGINE=MyISAM SELECT @i:=@i+1 AS `row_id`, `p.x`,`p.y`,`p.z`,`f.fofId`,`f.x`,`f.y`,`f.z`,`f.size` FROM `aggregation_tmp_112926` -- CALL paquDropTmp('aggregation_tmp_112926')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant