[Groonga-commit] pgroonga/pgroonga at 148cc68 [master] Add a SQL to test basic feature of PGroonga

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jan 12 23:44:01 JST 2015


Kouhei Sutou	2015-01-12 23:44:01 +0900 (Mon, 12 Jan 2015)

  New Revision: 148cc68224bec22691990a6cb27e64bd368261f6
  https://github.com/pgroonga/pgroonga/commit/148cc68224bec22691990a6cb27e64bd368261f6

  Message:
    Add a SQL to test basic feature of PGroonga

  Added files:
    test.sql

  Added: test.sql (+43 -0) 100644
===================================================================
--- /dev/null
+++ test.sql    2015-01-12 23:44:01 +0900 (22f39f5)
@@ -0,0 +1,43 @@
+DROP TABLE IF EXISTS memos;
+CREATE TABLE memos (
+  id integer,
+  content text
+);
+
+INSERT INTO memos VALUES (1, 'PostgreSQL is a RDBMS.');
+INSERT INTO memos VALUES (2, 'Groonga is fast full text search engine.');
+
+CREATE INDEX grnindex ON memos USING pgroonga (content);
+
+SET enable_seqscan = off;
+SET enable_indexscan = on;
+SET enable_bitmapscan = on;
+
+SELECT id, content
+  FROM memos
+ WHERE content %% 'is';
+
+SELECT id, content
+  FROM memos
+ WHERE content %% 'text';
+
+INSERT INTO memos VALUES (3, 'PGroonga is a PostgreSQL plugin that uses Groonga.');
+
+SELECT id, content
+  FROM memos
+ WHERE content %% 'postgresql';
+
+UPDATE memos SET content = 'Mroonga is a MySQL plugin that uses Groonga.'
+ WHERE id = 3;
+
+SELECT id, content
+  FROM memos
+ WHERE content %% 'postgresql';
+
+SELECT id, content
+  FROM memos
+ WHERE content %% 'mysql';
+
+SELECT id, content
+  FROM memos
+ WHERE content %% 'mysql' OR content %% 'groonga';
-------------- next part --------------
HTML����������������������������...
Download 



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