Navigation Menu

Skip to content

Commit

Permalink
Don't use OR
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 18, 2015
1 parent a34d79f commit 25a18ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
15 changes: 11 additions & 4 deletions expected/text/multiple/update.out
Expand Up @@ -19,16 +19,23 @@ SET enable_indexscan = on;
SET enable_bitmapscan = off;
SELECT id, title, content
FROM memos
WHERE title %% 'Groonga' OR content %% 'Groonga';
WHERE content %% 'Groonga';
id | title | content
----+---------+--------------------------------------
2 | Groonga | is fast full text search engine.
3 | Mroonga | is a MySQL plugin that uses Groonga.
(2 rows)
(1 row)

SELECT id, title, content
FROM memos
WHERE title %% 'Mroonga';
id | title | content
----+---------+--------------------------------------
3 | Mroonga | is a MySQL plugin that uses Groonga.
(1 row)

SELECT id, title, content
FROM memos
WHERE title %% 'Mroonga' AND content %% 'MySQL';
WHERE content %% 'MySQL';
id | title | content
----+---------+--------------------------------------
3 | Mroonga | is a MySQL plugin that uses Groonga.
Expand Down
8 changes: 6 additions & 2 deletions sql/text/multiple/update.sql
Expand Up @@ -24,10 +24,14 @@ SET enable_bitmapscan = off;

SELECT id, title, content
FROM memos
WHERE title %% 'Groonga' OR content %% 'Groonga';
WHERE content %% 'Groonga';

SELECT id, title, content
FROM memos
WHERE title %% 'Mroonga' AND content %% 'MySQL';
WHERE title %% 'Mroonga';

SELECT id, title, content
FROM memos
WHERE content %% 'MySQL';

DROP TABLE memos;

0 comments on commit 25a18ed

Please sign in to comment.