Skip to content

Commit

Permalink
Add a test for "ORDER BY DESC"
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Feb 5, 2015
1 parent 956bbfa commit e6c8971
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
30 changes: 30 additions & 0 deletions expected/compare/integer/order_by_limit/desc.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CREATE TABLE ids (
id integer
);
INSERT INTO ids VALUES (2);
INSERT INTO ids VALUES (7);
INSERT INTO ids VALUES (6);
INSERT INTO ids VALUES (4);
INSERT INTO ids VALUES (5);
INSERT INTO ids VALUES (8);
INSERT INTO ids VALUES (1);
INSERT INTO ids VALUES (10);
INSERT INTO ids VALUES (3);
INSERT INTO ids VALUES (9);
CREATE INDEX grnindex ON ids USING pgroonga (id);
SET enable_seqscan = off;
SET enable_indexscan = on;
SELECT id
FROM ids
ORDER BY id DESC
LIMIT 5;
id
----
10
9
8
7
6
(5 rows)

DROP TABLE ids;
26 changes: 26 additions & 0 deletions sql/compare/integer/order_by_limit/desc.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CREATE TABLE ids (
id integer
);

INSERT INTO ids VALUES (2);
INSERT INTO ids VALUES (7);
INSERT INTO ids VALUES (6);
INSERT INTO ids VALUES (4);
INSERT INTO ids VALUES (5);
INSERT INTO ids VALUES (8);
INSERT INTO ids VALUES (1);
INSERT INTO ids VALUES (10);
INSERT INTO ids VALUES (3);
INSERT INTO ids VALUES (9);

CREATE INDEX grnindex ON ids USING pgroonga (id);

SET enable_seqscan = off;
SET enable_indexscan = on;

SELECT id
FROM ids
ORDER BY id DESC
LIMIT 5;

DROP TABLE ids;

0 comments on commit e6c8971

Please sign in to comment.