[Groonga-commit] pgroonga/pgroonga at e6c8971 [master] Add a test for "ORDER BY DESC"

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Feb 6 00:25:00 JST 2015


Kouhei Sutou	2015-02-06 00:25:00 +0900 (Fri, 06 Feb 2015)

  New Revision: e6c8971be3b925ae326b26a26bf2e22701fdb607
  https://github.com/pgroonga/pgroonga/commit/e6c8971be3b925ae326b26a26bf2e22701fdb607

  Message:
    Add a test for "ORDER BY DESC"

  Added files:
    expected/compare/integer/order_by_limit/desc.out
    sql/compare/integer/order_by_limit/desc.sql

  Added: expected/compare/integer/order_by_limit/desc.out (+30 -0) 100644
===================================================================
--- /dev/null
+++ expected/compare/integer/order_by_limit/desc.out    2015-02-06 00:25:00 +0900 (9b91057)
@@ -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;

  Added: sql/compare/integer/order_by_limit/desc.sql (+26 -0) 100644
===================================================================
--- /dev/null
+++ sql/compare/integer/order_by_limit/desc.sql    2015-02-06 00:25:00 +0900 (4b2e274)
@@ -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;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index