- PostgreSQL has many extension points including data types, functions, operators and more. This allows it to be extended with tools like Groonga.
- There are two main ways to integrate Groonga with PostgreSQL: textsearch_groonga for full text search and groonga_fdw, which allows Groonga to be accessed via foreign tables.
- textsearch_groonga adds Groonga's text search capabilities to PostgreSQL for features like morphological analysis and N-gram search. groonga_fdw treats a Groonga database as an external data source so it can be queried from PostgreSQL using standard SQL.
5. PGXN
• PostgreSQL Extension Network
• Central distribution system for
PostgreSQL Extension
• Inspired by CPAN for Perl library
• Provides:
• Manager, API, Search, Client
• under development ...
5
18. SQL/MED
• Management of External Data
• SQL Standard (SQL:2003)
• Consists:
• Foreign Table
• DATALINK
16
19. SQL/MED
• Management of External Data
• SQL Standard (SQL:2003)
• Consists:
• Foreign Table Implemented as FDW
in Postgres
• DATALINK
16
20. FDW
• Foreign Data Wrapper
• External data as Table of PostgreSQL
• Available from 9.1
• Only “SELECT” statement is available
now
• Very simple API interface
• Only 6 callbacks are required :)
17
23. FDW
• Example:
• Oracle
• MySQL
• Redis
• Amazon S3
• Twitter
• and more... (see http://pgxn.org/tag/fdw/ )
19
24. groonga_fdw
• Foreign Data Wrapper for groonga
• You can query groonga via postgres
with usual SQL
• Under Development
20
25. How to use
Install # CREATE EXTENTION groonga_fdw;
# CREATE SERVER groonga_server
FOREIGN DATA WRAPPER groonga_fdw
Connect OPTIONS ( dbpath ‘ );
# CREATE FOREIGN TABLE groonga_fdw_tutorial (
_key text
title text
)
Table SERVER groonga_server
OPTIONS ( ... );
21
28. Summary
• PostgreSQL is quite extensible
• Two ways to work with groonga
• textsearch_groonga
• groonga_fdw
• PostgreSQL and groonga are good friend :)
24