24. 24
Parallel sequential scans, joins and aggregates
Elimination of repetitive scanning of old data by
autovacuum
Synchronous replication now allows multiple standby
servers for increased reliability
Full-text search for phrases
Support for remote joins, sorts, and updates in
postgres_fdw
Substantial performance improvements, especially in
the area of improving scalability on many-CPU servers
PostgreSQL 9.6 主な新機能
25. 25
PostgreSQL 9.6 主な新機能
Parallel sequential scans, joins and aggregates
Elimination of repetitive scanning of old data by
autovacuum
Synchronous replication now allows multiple standby
servers for increased reliability
Full-text search for phrases
Support for remote joins, sorts, and updates in
postgres_fdw
Substantial performance improvements, especially in
the area of improving scalability on many-CPU servers
36. 36
PostgreSQL 9.6 新機能
Parallel sequential scans, joins and aggregates
Elimination of repetitive scanning of old data by
autovacuum
Synchronous replication now allows multiple standby
servers for increased reliability
Full-text search for phrases
Support for remote joins, sorts, and updates in
postgres_fdw
Substantial performance improvements, especially in
the area of improving scalability on many-CPU servers
40. 40
PostgreSQL 9.6 新機能
Parallel sequential scans, joins and aggregates
Elimination of repetitive scanning of old data by
autovacuum
Synchronous replication now allows multiple standby
servers for increased reliability
Full-text search for phrases
Support for remote joins, sorts, and updates in
postgres_fdw
Substantial performance improvements, especially in
the area of improving scalability on many-CPU servers
45. 45
PostgreSQL 9.6 新機能
Parallel sequential scans, joins and aggregates
Elimination of repetitive scanning of old data by
autovacuum
Synchronous replication now allows multiple standby
servers for increased reliability
Full-text search for phrases
Support for remote joins, sorts, and updates in
postgres_fdw
Substantial performance improvements, especially in
the area of improving scalability on many-CPU servers
48. 48
tsearch=# SELECT
data
FROM animal
WHERE to_tsvector('english', data) @@ to_tsquery('english', 'dog');
data
--------------------------------------------------
I like cats and dogs.
In my bed, four dogs and five cats are sleeping.
Miss Magee's dog is very strong.
(3 rows)
tsearch=# SELECT
data
FROM animal
WHERE to_tsvector('english', data) @@ to_tsquery('english', 'dog & cat');
data
--------------------------------------------------
I like cats and dogs.
In my bed, four dogs and five cats are sleeping.
(2 rows)
これまでの全文検索
複数のワードの指定はできたが、語順を意識した検索は不可
(dog, cat の順に出現する文書も cat, dog の順に出現する文書
も両方ヒットしていた )
49. 49
tsearch=# SELECT
data
FROM animal
WHERE
to_tsvector('japanese', data) @@
tsquery_phrase(
to_tsquery('japanese', 'dog'), to_tsquery('japanese', 'cat'), 3);
data
--------------------------------------------------
In my bed, four dogs and five cats are sleeping.
(1 row)
tsearch=# SELECT
data
FROM animal
WHERE
to_tsvector('japanese', data) @@
tsquery_phrase(
to_tsquery('japanese', 'cat'), to_tsquery('japanese', 'dog'), 3);
data
-----------------------
I like cats and dogs.
(1 row)
フレーズ検索
それぞれ、「 dog→cat 」「 cat→dog 」の順序で並んだテキ
ストが検索されている。
フレーズ検索関数 tsquery_phrase() を使う。
50. 50
tsearch=# SELECT
data
FROM animal
WHERE
to_tsvector(data) @@
(to_tsquery('like') <-> to_tsquery('cat'));
data
-----------------------
I like cats and dogs.
(1 row)
<-> 演算子
X <-> Y は
tsquery_phrase( X, Y, 1) と同義です。
全文検索用演算子として、 9.6 では
新たに
<->
という演算子が追加された。
※ 演算子が簡単に追加できるのも PostgreSQL のいいところ。
58. 58
PostgreSQL 9.6 新機能
Parallel sequential scans, joins and aggregates
Elimination of repetitive scanning of old data by
autovacuum
Synchronous replication now allows multiple standby
servers for increased reliability
Full-text search for phrases
Support for remote joins, sorts, and updates in
postgres_fdw
Substantial performance improvements, especially in
the area of improving scalability on many-CPU servers
67. 67
PostgreSQL 9.6 新機能
Parallel sequential scans, joins and aggregates
Elimination of repetitive scanning of old data by
autovacuum
Synchronous replication now allows multiple standby
servers for increased reliability
Full-text search for phrases
Support for remote joins, sorts, and updates in
postgres_fdw
Substantial performance improvements, especially in
the area of improving scalability on many-CPU servers