Fix arbitrary order issues

Simply added some ORDER BYs.
pull/858/head
Jason Petersen 2016-10-05 10:49:06 -06:00
parent 8a626c0731
commit 4152b9f295
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
4 changed files with 23 additions and 17 deletions

View File

@ -757,33 +757,35 @@ DEBUG: Plan is router executable
SELECT id
FROM articles_hash
WHERE author_id = 1
GROUP BY id;
GROUP BY id
ORDER BY id;
DEBUG: predicate pruning for shardId 840001
DEBUG: Creating router plan
DEBUG: Plan is router executable
id
----
41
11
31
1
11
21
31
41
(5 rows)
-- single shard select with distinct is router plannable
SELECT distinct id
SELECT DISTINCT id
FROM articles_hash
WHERE author_id = 1;
WHERE author_id = 1
ORDER BY id;
DEBUG: predicate pruning for shardId 840001
DEBUG: Creating router plan
DEBUG: Plan is router executable
id
----
41
11
31
1
11
21
31
41
(5 rows)
-- single shard aggregate is router plannable

View File

@ -494,17 +494,18 @@ DEBUG: Plan is router executable
SELECT id
FROM articles
WHERE author_id = 1
GROUP BY id;
GROUP BY id
ORDER BY id;
DEBUG: predicate pruning for shardId 850001
DEBUG: Creating router plan
DEBUG: Plan is router executable
id
----
41
11
31
1
11
21
31
41
(5 rows)
-- copying from a single shard table does not require the master query

View File

@ -334,12 +334,14 @@ SELECT *
SELECT id
FROM articles_hash
WHERE author_id = 1
GROUP BY id;
GROUP BY id
ORDER BY id;
-- single shard select with distinct is router plannable
SELECT distinct id
SELECT DISTINCT id
FROM articles_hash
WHERE author_id = 1;
WHERE author_id = 1
ORDER BY id;
-- single shard aggregate is router plannable
SELECT avg(word_count)

View File

@ -260,7 +260,8 @@ SELECT *
SELECT id
FROM articles
WHERE author_id = 1
GROUP BY id;
GROUP BY id
ORDER BY id;
-- copying from a single shard table does not require the master query
COPY articles_single_shard TO stdout;