mirror of https://github.com/citusdata/citus.git
multi_subquery_behavioral_analytics.sql query fix by adding proper order by
parent
1b06b2b306
commit
b6eb0c2823
|
@ -1443,30 +1443,30 @@ FROM
|
|||
WHERE
|
||||
(ma.value_2 > 1)
|
||||
ORDER BY
|
||||
prob DESC, user_id DESC
|
||||
prob DESC, value_2 DESC, user_id DESC
|
||||
LIMIT 10
|
||||
) AS ma
|
||||
ON (a.a_user_id = ma.user_id)
|
||||
) AS inner_sub
|
||||
ORDER BY
|
||||
prob DESC, user_id DESC
|
||||
prob DESC, value_2 DESC, user_id DESC, event_type DESC
|
||||
LIMIT 10
|
||||
) AS outer_sub
|
||||
ORDER BY
|
||||
prob DESC, event_type DESC, user_id DESC
|
||||
prob DESC, value_2 DESC, user_id DESC, event_type DESC
|
||||
LIMIT 10;
|
||||
user_id | event_type
|
||||
---------+------------
|
||||
2 | 5
|
||||
3 | 5
|
||||
3 | 4
|
||||
3 | 4
|
||||
3 | 4
|
||||
3 | 4
|
||||
2 | 4
|
||||
2 | 4
|
||||
3 | 3
|
||||
3 | 3
|
||||
3 | 3
|
||||
3 | 3
|
||||
2 | 3
|
||||
2 | 3
|
||||
3 | 3
|
||||
(10 rows)
|
||||
|
||||
-- very similar query but produces different result due to
|
||||
|
|
|
@ -1203,17 +1203,17 @@ FROM
|
|||
WHERE
|
||||
(ma.value_2 > 1)
|
||||
ORDER BY
|
||||
prob DESC, user_id DESC
|
||||
prob DESC, value_2 DESC, user_id DESC
|
||||
LIMIT 10
|
||||
) AS ma
|
||||
ON (a.a_user_id = ma.user_id)
|
||||
) AS inner_sub
|
||||
ORDER BY
|
||||
prob DESC, user_id DESC
|
||||
prob DESC, value_2 DESC, user_id DESC, event_type DESC
|
||||
LIMIT 10
|
||||
) AS outer_sub
|
||||
ORDER BY
|
||||
prob DESC, event_type DESC, user_id DESC
|
||||
prob DESC, value_2 DESC, user_id DESC, event_type DESC
|
||||
LIMIT 10;
|
||||
|
||||
-- very similar query but produces different result due to
|
||||
|
|
Loading…
Reference in New Issue