SlideShare une entreprise Scribd logo
1  sur  22
1
Join Heterogeneous Databases Using
PostgreSQL Foreign Data Wrappers
Ibrar.ahmed@percona.com
Senior Software Engineer - PostgreSQL Consultant
PostgreSQL’s Foreign Data Wrapper Based on ISO standard SQL/MED (SQL for Managing External Data).
Ibrar Ahmed
2
Why? Accessing Data From Multiple Sources
SELECT * from multiple “Database Engines” and generate results?
3
Application Architecture 1/2
libmysqlclient
Libpq
libmongo-c
JDBC
ODBC
U
S
E
R
A
P
P
L
I
C
A
T
I
O
N
Join
PostgreSQL
Module
MongoDB
Module
JDBC
Module
JDBC
Module
MySQL
Module
ODBC
Module
JDBC
4
SQL-MED - Management of External Data
• SQL/MED provides extensions to SQL that define FDW (Foreign Data
Wrapper)
• PostgreSQL started implementing in its core since PostgreSQL Version 9.1
• PostgreSQL community builds PostgreSQL FDW called postgresql_fdw.
Now there are many FDWs implemented by other people
https://wiki.postgresql.org/wiki/Foreign_data_wrappers
5
FDW
Application Architecture 2/2
libmysqlclient
Libpq
libmongo-c
JDBC
ODBC
U
S
E
R
A
P
P
L
I
C
A
T
I
O
N
Join
PostgreSQL
Module
MongoDB
Module
Spark
Module
Hive
Module
MySQL
Module
Clickhouse
Module
JDBC
postgres_fdw
mogo_fdw
hdfs_fdw
hdfs_fdw
mysql_fdw
file_fdw
P
o
s
t
g
r
e
S
Q
L
6
Example
US States
Continents, Countries
Flight Information
pg_tbl_states
mysql_tbl_continents
mysql_tbl_contries
clickhouse_tbl_ontime
7
Set up mysqldb_fdw (MySQL)
CREATE EXTENSION mysqldb_fdw;
CREATE SERVER mysql_svr
FOREIGN DATA WRAPPER mysqldb_fdw
OPTIONS (host '127.0.0.1',
port '3306');
CREATE USER MAPPING FOR postgres
SERVER mysql_svr
OPTIONS (username 'mysql_user', password 'mysql_pass');
CREATE FOREIGN TABLE mysql_tbl_continents
(
code VARCHAR(2),
name VARCHAR(255)
) SERVER mysql_svr OPTIONS(dbname ‘db’);
CREATE FOREIGN TABLE mysql_tbl_countries
(
code VARCHAR(2),
name VARCHAR(255),
full_name VARCHAR(255),
iso3 CHAR(3),
number INTEGER,
continent_code VARCHAR(2)
) SERVER mysql_svr OPTIONS (dbname ‘db’);
8
Set up clickhousedb_fdw (ClickHouse)
CREATE EXTENSION clickhousedb_fdw;
CREATE SERVER clickhouse_svr FOREIGN DATA WRAPPER clickhousedb_fdw
OPTIONS(dbname 'test_database', driver '/use/lib/libclickhouseodbc.so');
CREATE USER MAPPING FOR postgres
SERVER clickhouse_svr
OPTIONS (user ‘clickhouse_user’, password ’clickhouse_pass’);
CREATE FOREIGN TABLE clickhouse_tbl_ontime(
Year INTEGER,
Quarter INTEGER,
Month INTEGER,
…
) SERVER clickhouse_svr OPTIONS (table_name ’ontime’);
9
SELECT data from Clickhouse using clickhousedb_fdw
postgres=# SELECT a."Year", c1/c2 as value
FROM ( SELECT "Year", count(*)*1000 as c1
FROM clickhouse_tbl_ontime
WHERE "DepDelay">10 GROUP BY "Year") a
INNER JOIN (select "Year", count(*) as c2
FROM clickhouse_tbl_ontime
GROUP BY "Year" ) b on a."Year"=b."Year" LIMIT 3;
Year | value
------+-----------
1987 | 199
1988 | 654182000
(2 rows)
10
SELECT data from MySQL using mysqldb_fdw 1/2
postgres=# SELECT * FROM mysql_tbl_continents;
code | name
------+---------------
AF | Africa
AN | Antarctica
AS | Asia
EU | Europe
NA | North America
OC | Oceania
SA | South America
(7 rows)
postgres=# SELECT code, name, continent_code
FROM mysql_tbl_countries LIMIT 7;
code | name | continent_code
------+----------------------+----------------
AD | Andorra | EU
AE | United Arab Emirates | AS
AF | Afghanistan | AS
AG | Antigua and Barbuda | NA
AI | Anguilla | NA
AL | Albania | EU
AM | Armenia | AS
(7 rows)
Data comes from MySQL
Database
11
SELECT data from MySQL using mysqldb_fdw 2/2
postgres=# SELECT country.code as code, country.name country, continent.name
FROM mysql_tbl_continents continent, mysql_tbl_countries country
WHERE continent.code = country.continent_code LIMIT 3;
code | country | continent
------+--------------+--------
AO | Angola | Africa
BF | Burkina Faso | Africa
BI | Burundi | Africa
(3 rows)
12
Join ClickHouse, MySQL and PostgreSQL using FDW
postgres=# SELECT "Year", pg.code,
"OriginStateName",pg.country_code,my.name
FROM clickhouse_tbl_ontime ch
LEFT JOIN pg_tbl_states pg ON pg.name = ch."OriginStateName"
LEFT JOIN mysql_tbl_countries my ON pg.country_code=my.code LIMIT 3;
Year | code | OriginStateName | country_code | name
------+------+-----------------+--------------+--------------------------
2011 | MO | Missouri | US | United States of America
2011 | MO | Missouri | US | United States of America
2011 | MO | Missouri | US | United States of America
(3 rows)
13
EXPLAIN: Join ClickHouse, MySQL and PostgreSQL
postgres=# EXPLAIN VERBOSE SELECT "Year", pg.code, "OriginStateName", pg.country_code,my.name from clickhouse_tbl_ontime
ch LEFT JOIN pg_tbl_states pg ON pg.name = ch."OriginStateName" LEFT JOIN mysql_tbl_countries my ON pg.country_code =
my.code limit 3;
QUERY PLAN
-> Hash Right Join (cost=10.00..1900.21 rows=5000 width=558)
Hash Cond: ((pg.name)::text = ch."OriginStateName")
-> Nested Loop Left Join (cost=10.00..1899.09 rows=295 width=532)
Join Filter: ((pg.country_code)::text = (my.code)::text)
-> Seq Scan on public.pg_tbl_states pg (cost=0.00..1.59 rows=59 width=16)
-> Materialize (cost=10.00..1015.00 rows=1000 width=528)
-> Foreign Scan on public.mysql_tbl_countries my (cost=10.00..1010.00 rows=1000 width=528)
Remote query: SELECT `code`, `name` FROM `db`.`mysql_tbl_countries`
-> Hash (cost=0.00..0.00 rows=0 width=36)
-> Foreign Scan on public.clickhouse_tbl_ontime ch (cost=0.00..0.00 rows=0 width=36)
Output: ch."Year", ch."OriginStateName"
Remote SQL: SELECT "Year", "OriginStateName" FROM "default".ontime
14
Push Down – A Performance Feature
• Operator and function pushdown
• Predicate push down
• Aggregate push down
• Join push down
14
15
PostgreSQL Foreign Data Wrapper – Operator and Function Pushdown
postgres=# EXPLAIN VERBOSE SELECT avg("DepDelay") FROM clickhouse_tbl_ontime WHERE "DepDelay" <10;
Foreign Scan (cost=1.00..-1.00 rows=1000 width=32)
Output: (avg("DepDelay"))
Relations: Aggregate on (clickhouse_tbl_ontime)
Remote SQL: SELECT avg("DepDelay") FROM "default".ontime WHERE (("DepDelay" < 10))
(4 rows)
15
postgres=# EXPLAIN VERBOSE SELECT count(*) FROM mysql_tbl_countries WHERE continent_code = 'EU’;
Aggregate (cost=1012.50..1012.51 rows=1 width=8)
Output: count(*)
-> Foreign Scan on public.mysql_tbl_countries (cost=10.00..1010.00 rows=1000 width=0)
Output: code, name, full_name, iso3, number, continent_code
Local server startup cost: 10
Remote query: SELECT NULL FROM `db`.`mysql_tbl_countries` WHERE ((`continent_code` = 'EU'))
(6 rows)
16
PostgreSQL Foreign Data Wrapper – Operator and Function Pushdown
postgres=# SELECT count(*) FROM clickhouse_tbl_ontime;
count
-----------
184539910
16
postgres=# EXPLAIN VERBOSE SELECT "Year" FROM clickhouse_tbl_ontime WHERE "Year"=1989;
QUERY PLAN
--------------------------------------------------------------------------------
Foreign Scan on public.clickhouse_tbl_ontime
Output: "Year"
Remote SQL: SELECT "Year" FROM "default".ontime WHERE (("Year" = 1989)
postgres=# SELECT count(*) FROM clickhouse_tbl_ontime WHERE "Year"=1989;
count
---------
5041200
17
PostgreSQL Foreign Data Wrapper – JOIN Push Down
postgres=# EXPLAIN VERBOSE SELECT a."Year" FROM clickhouse_tbl_ontime a LEFT JOIN clickhouse_tbl_ontime b ON a."Year" = b."Year";
QUERY PLAN
Foreign Scan (cost=1.00..1.00 rows=1000 width=50)
Output: a."Year"
Relations: (clickhouse_tbl_ontime a) LEFT JOIN (clickhouse_tbl_ontime b)
Remote SQL: SELECT r1."Year" FROM "default".ontime r1 ALL LEFT JOIN "default".ontime r2 ON (((r1."Year" = r2."Year")))
17
postgres=# EXPLAIN VERBOSE SELECT a.code FROM mysql_tbl_countries a LEFT JOIN mysql_tbl_countries b ON a.code = b.code;
QUERY PLAN
Hash Left Join (cost=1032.50..2210.00 rows=5000 width=12)
Output: a.code
Hash Cond: ((a.code)::text = (b.code)::text)
-> Foreign Scan on public.mysql_tbl_countries a (cost=10.00..1010.00 rows=1000 width=12)
Output: a.code, a.name, a.full_name, a.iso3, a.number, a.continent_code
Local server startup cost: 10
Remote query: SELECT `code` FROM `db`.`mysql_tbl_countries`
-> Hash (cost=1010.00..1010.00 rows=1000 width=12)
Output: b.code
-> Foreign Scan on public.mysql_tbl_countries b (cost=10.00..1010.00 rows=1000 width=12)
Output: b.code
Local server startup cost: 10
Remote query: SELECT `code` FROM `db`.`mysql_tbl_countries`
18
PostgreSQL Foreign Data Wrapper – Aggregate Push Down
postgres=# EXPLAIN VERBOSE SELECT count(*) FROM clickhouse_tbl_ontime;
QUERY PLAN
-----------------------------------------------------
Foreign Scan (cost=1.00..-1.00 rows=1000 width=8)
Output: (count(*))
Relations: Aggregate on (clickhouse_tbl_ontime)
Remote SQL: SELECT count(*) FROM "default".ontime
(4 rows)
18
postgres=# EXPLAIN VERBOSE SELECT count(*) from mysql_tbl_continents;
QUERY PLAN
--------------------------------------------------------------------------------------------
Aggregate (cost=1012.50..1012.51 rows=1 width=8)
Output: count(*)
-> Foreign Scan on public.mysql_tbl_continents (cost=10.00..1010.00 rows=1000 width=0)
Output: code, name
Local server startup cost: 10
Remote query: SELECT NULL FROM `db`.`mysql_tbl_continents`
(6 rows)
19
Other PostgreSQL Foreign Data Wrapper Features
• Writeable Foreign Data Wrapper*
• Connection Pooling
19
20
Join Us at Percona Live
https://www.percona.com/live/19/
Percona Live 2019takes place in Austin, Texas fromMay 28-30,2019atthe Hyatt
Regency.
Percona Live provides an opportunity to network with peers and
technology professionals. Mingle with all types of database
community members: DBAs, developers, C-level executives and
the latest database technology trend-setters.
Dedicated PostgreSQL Tutorials and Breakout Sessions in the PostgreSQLTrack!ADVANCEDRATETICKETSONSALE!
21
About Percona
Solutions for your success with MySQL, MariaDB, MongoDB and PostgreSQL
Providing support, managed services, consultancy, and software
Our software is 100% Open Source and free
Support a broad ecosystem – open source databases on premise and in the cloud
Founded in 2006 by former MySQL employees, over 170 staff worldwide
More than 3000 customers, including top internet companies and enterprises
Champions of Unbiased
Open Source Database Solutions

Contenu connexe

Tendances

My SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTNMy SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTNRonald Bradford
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스PgDay.Seoul
 
Beyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the codeBeyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the codeWim Godden
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalabilityWim Godden
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeWim Godden
 
Advanced pg_stat_statements: Filtering, Regression Testing & more
Advanced pg_stat_statements: Filtering, Regression Testing & moreAdvanced pg_stat_statements: Filtering, Regression Testing & more
Advanced pg_stat_statements: Filtering, Regression Testing & moreLukas Fittl
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeWim Godden
 
Writing A Foreign Data Wrapper
Writing A Foreign Data WrapperWriting A Foreign Data Wrapper
Writing A Foreign Data Wrapperpsoo1978
 
MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용I Goo Lee
 
SunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLSunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLGabriela Ferrara
 
Data Munging in R - Chicago R User Group
Data Munging in R - Chicago R User GroupData Munging in R - Chicago R User Group
Data Munging in R - Chicago R User Groupdesignandanalytics
 
Database Wizardry for Legacy Applications
Database Wizardry for Legacy ApplicationsDatabase Wizardry for Legacy Applications
Database Wizardry for Legacy ApplicationsGabriela Ferrara
 
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and OptimizationPgDay.Seoul
 
Common Table Expressions in MariaDB 10.2
Common Table Expressions in MariaDB 10.2Common Table Expressions in MariaDB 10.2
Common Table Expressions in MariaDB 10.2Sergey Petrunya
 
My sql regis_handsonlab
My sql regis_handsonlabMy sql regis_handsonlab
My sql regis_handsonlabsqlhjalp
 
Massively Distributed Backups at Facebook Scale - Shlomo Priymak, Facebook - ...
Massively Distributed Backups at Facebook Scale - Shlomo Priymak, Facebook - ...Massively Distributed Backups at Facebook Scale - Shlomo Priymak, Facebook - ...
Massively Distributed Backups at Facebook Scale - Shlomo Priymak, Facebook - ...DevOpsDays Tel Aviv
 

Tendances (20)

My SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTNMy SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTN
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
 
Beyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the codeBeyond PHP - It's not (just) about the code
Beyond PHP - It's not (just) about the code
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Advanced pg_stat_statements: Filtering, Regression Testing & more
Advanced pg_stat_statements: Filtering, Regression Testing & moreAdvanced pg_stat_statements: Filtering, Regression Testing & more
Advanced pg_stat_statements: Filtering, Regression Testing & more
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Writing A Foreign Data Wrapper
Writing A Foreign Data WrapperWriting A Foreign Data Wrapper
Writing A Foreign Data Wrapper
 
Hadoop on aws amazon
Hadoop on aws amazonHadoop on aws amazon
Hadoop on aws amazon
 
MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용MySQL 5.7 NF – JSON Datatype 활용
MySQL 5.7 NF – JSON Datatype 활용
 
SunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLSunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQL
 
Data Munging in R - Chicago R User Group
Data Munging in R - Chicago R User GroupData Munging in R - Chicago R User Group
Data Munging in R - Chicago R User Group
 
Rug hogan-10-03-2012
Rug hogan-10-03-2012Rug hogan-10-03-2012
Rug hogan-10-03-2012
 
Database Wizardry for Legacy Applications
Database Wizardry for Legacy ApplicationsDatabase Wizardry for Legacy Applications
Database Wizardry for Legacy Applications
 
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
 
Common Table Expressions in MariaDB 10.2
Common Table Expressions in MariaDB 10.2Common Table Expressions in MariaDB 10.2
Common Table Expressions in MariaDB 10.2
 
My sql1
My sql1My sql1
My sql1
 
My sql regis_handsonlab
My sql regis_handsonlabMy sql regis_handsonlab
My sql regis_handsonlab
 
Indexing
IndexingIndexing
Indexing
 
Massively Distributed Backups at Facebook Scale - Shlomo Priymak, Facebook - ...
Massively Distributed Backups at Facebook Scale - Shlomo Priymak, Facebook - ...Massively Distributed Backups at Facebook Scale - Shlomo Priymak, Facebook - ...
Massively Distributed Backups at Facebook Scale - Shlomo Priymak, Facebook - ...
 

Similaire à Postgres Conference (PgCon) New York 2019

PerlApp2Postgresql (2)
PerlApp2Postgresql (2)PerlApp2Postgresql (2)
PerlApp2Postgresql (2)Jerome Eteve
 
Develop Python Applications with MySQL Connector/Python
Develop Python Applications with MySQL Connector/PythonDevelop Python Applications with MySQL Connector/Python
Develop Python Applications with MySQL Connector/PythonJesper Wisborg Krogh
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeWim Godden
 
Postgres Performance for Humans
Postgres Performance for HumansPostgres Performance for Humans
Postgres Performance for HumansCitus Data
 
DAC4B 2015 - Polybase
DAC4B 2015 - PolybaseDAC4B 2015 - Polybase
DAC4B 2015 - PolybaseŁukasz Grala
 
20141011 mastering mysqlnd
20141011 mastering mysqlnd20141011 mastering mysqlnd
20141011 mastering mysqlnddo_aki
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeWim Godden
 
Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.Keshav Murthy
 
The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212Mahmoud Samir Fayed
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeWim Godden
 
The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84Mahmoud Samir Fayed
 
RMySQL Tutorial For Beginners
RMySQL Tutorial For BeginnersRMySQL Tutorial For Beginners
RMySQL Tutorial For BeginnersRsquared Academy
 
MySQL 5.7 Tutorial Dutch PHP Conference 2015
MySQL 5.7 Tutorial Dutch PHP Conference 2015MySQL 5.7 Tutorial Dutch PHP Conference 2015
MySQL 5.7 Tutorial Dutch PHP Conference 2015Dave Stokes
 
MySQL 5.7. Tutorial - Dutch PHP Conference 2015
MySQL 5.7. Tutorial - Dutch PHP Conference 2015MySQL 5.7. Tutorial - Dutch PHP Conference 2015
MySQL 5.7. Tutorial - Dutch PHP Conference 2015Dave Stokes
 
112 portfpres.pdf
112 portfpres.pdf112 portfpres.pdf
112 portfpres.pdfsash236
 

Similaire à Postgres Conference (PgCon) New York 2019 (20)

PerlApp2Postgresql (2)
PerlApp2Postgresql (2)PerlApp2Postgresql (2)
PerlApp2Postgresql (2)
 
Develop Python Applications with MySQL Connector/Python
Develop Python Applications with MySQL Connector/PythonDevelop Python Applications with MySQL Connector/Python
Develop Python Applications with MySQL Connector/Python
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the code
 
Postgres Performance for Humans
Postgres Performance for HumansPostgres Performance for Humans
Postgres Performance for Humans
 
MySQLinsanity
MySQLinsanityMySQLinsanity
MySQLinsanity
 
DAC4B 2015 - Polybase
DAC4B 2015 - PolybaseDAC4B 2015 - Polybase
DAC4B 2015 - Polybase
 
20141011 mastering mysqlnd
20141011 mastering mysqlnd20141011 mastering mysqlnd
20141011 mastering mysqlnd
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.
 
Perl Programming - 04 Programming Database
Perl Programming - 04 Programming DatabasePerl Programming - 04 Programming Database
Perl Programming - 04 Programming Database
 
MongoDB and Python
MongoDB and PythonMongoDB and Python
MongoDB and Python
 
The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212The Ring programming language version 1.10 book - Part 36 of 212
The Ring programming language version 1.10 book - Part 36 of 212
 
Python and MongoDB
Python and MongoDB Python and MongoDB
Python and MongoDB
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
Presentation
PresentationPresentation
Presentation
 
The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84The Ring programming language version 1.2 book - Part 17 of 84
The Ring programming language version 1.2 book - Part 17 of 84
 
RMySQL Tutorial For Beginners
RMySQL Tutorial For BeginnersRMySQL Tutorial For Beginners
RMySQL Tutorial For Beginners
 
MySQL 5.7 Tutorial Dutch PHP Conference 2015
MySQL 5.7 Tutorial Dutch PHP Conference 2015MySQL 5.7 Tutorial Dutch PHP Conference 2015
MySQL 5.7 Tutorial Dutch PHP Conference 2015
 
MySQL 5.7. Tutorial - Dutch PHP Conference 2015
MySQL 5.7. Tutorial - Dutch PHP Conference 2015MySQL 5.7. Tutorial - Dutch PHP Conference 2015
MySQL 5.7. Tutorial - Dutch PHP Conference 2015
 
112 portfpres.pdf
112 portfpres.pdf112 portfpres.pdf
112 portfpres.pdf
 

Dernier

DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Dernier (20)

DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 

Postgres Conference (PgCon) New York 2019

  • 1. 1 Join Heterogeneous Databases Using PostgreSQL Foreign Data Wrappers Ibrar.ahmed@percona.com Senior Software Engineer - PostgreSQL Consultant PostgreSQL’s Foreign Data Wrapper Based on ISO standard SQL/MED (SQL for Managing External Data). Ibrar Ahmed
  • 2. 2 Why? Accessing Data From Multiple Sources SELECT * from multiple “Database Engines” and generate results?
  • 4. 4 SQL-MED - Management of External Data • SQL/MED provides extensions to SQL that define FDW (Foreign Data Wrapper) • PostgreSQL started implementing in its core since PostgreSQL Version 9.1 • PostgreSQL community builds PostgreSQL FDW called postgresql_fdw. Now there are many FDWs implemented by other people https://wiki.postgresql.org/wiki/Foreign_data_wrappers
  • 6. 6 Example US States Continents, Countries Flight Information pg_tbl_states mysql_tbl_continents mysql_tbl_contries clickhouse_tbl_ontime
  • 7. 7 Set up mysqldb_fdw (MySQL) CREATE EXTENSION mysqldb_fdw; CREATE SERVER mysql_svr FOREIGN DATA WRAPPER mysqldb_fdw OPTIONS (host '127.0.0.1', port '3306'); CREATE USER MAPPING FOR postgres SERVER mysql_svr OPTIONS (username 'mysql_user', password 'mysql_pass'); CREATE FOREIGN TABLE mysql_tbl_continents ( code VARCHAR(2), name VARCHAR(255) ) SERVER mysql_svr OPTIONS(dbname ‘db’); CREATE FOREIGN TABLE mysql_tbl_countries ( code VARCHAR(2), name VARCHAR(255), full_name VARCHAR(255), iso3 CHAR(3), number INTEGER, continent_code VARCHAR(2) ) SERVER mysql_svr OPTIONS (dbname ‘db’);
  • 8. 8 Set up clickhousedb_fdw (ClickHouse) CREATE EXTENSION clickhousedb_fdw; CREATE SERVER clickhouse_svr FOREIGN DATA WRAPPER clickhousedb_fdw OPTIONS(dbname 'test_database', driver '/use/lib/libclickhouseodbc.so'); CREATE USER MAPPING FOR postgres SERVER clickhouse_svr OPTIONS (user ‘clickhouse_user’, password ’clickhouse_pass’); CREATE FOREIGN TABLE clickhouse_tbl_ontime( Year INTEGER, Quarter INTEGER, Month INTEGER, … ) SERVER clickhouse_svr OPTIONS (table_name ’ontime’);
  • 9. 9 SELECT data from Clickhouse using clickhousedb_fdw postgres=# SELECT a."Year", c1/c2 as value FROM ( SELECT "Year", count(*)*1000 as c1 FROM clickhouse_tbl_ontime WHERE "DepDelay">10 GROUP BY "Year") a INNER JOIN (select "Year", count(*) as c2 FROM clickhouse_tbl_ontime GROUP BY "Year" ) b on a."Year"=b."Year" LIMIT 3; Year | value ------+----------- 1987 | 199 1988 | 654182000 (2 rows)
  • 10. 10 SELECT data from MySQL using mysqldb_fdw 1/2 postgres=# SELECT * FROM mysql_tbl_continents; code | name ------+--------------- AF | Africa AN | Antarctica AS | Asia EU | Europe NA | North America OC | Oceania SA | South America (7 rows) postgres=# SELECT code, name, continent_code FROM mysql_tbl_countries LIMIT 7; code | name | continent_code ------+----------------------+---------------- AD | Andorra | EU AE | United Arab Emirates | AS AF | Afghanistan | AS AG | Antigua and Barbuda | NA AI | Anguilla | NA AL | Albania | EU AM | Armenia | AS (7 rows) Data comes from MySQL Database
  • 11. 11 SELECT data from MySQL using mysqldb_fdw 2/2 postgres=# SELECT country.code as code, country.name country, continent.name FROM mysql_tbl_continents continent, mysql_tbl_countries country WHERE continent.code = country.continent_code LIMIT 3; code | country | continent ------+--------------+-------- AO | Angola | Africa BF | Burkina Faso | Africa BI | Burundi | Africa (3 rows)
  • 12. 12 Join ClickHouse, MySQL and PostgreSQL using FDW postgres=# SELECT "Year", pg.code, "OriginStateName",pg.country_code,my.name FROM clickhouse_tbl_ontime ch LEFT JOIN pg_tbl_states pg ON pg.name = ch."OriginStateName" LEFT JOIN mysql_tbl_countries my ON pg.country_code=my.code LIMIT 3; Year | code | OriginStateName | country_code | name ------+------+-----------------+--------------+-------------------------- 2011 | MO | Missouri | US | United States of America 2011 | MO | Missouri | US | United States of America 2011 | MO | Missouri | US | United States of America (3 rows)
  • 13. 13 EXPLAIN: Join ClickHouse, MySQL and PostgreSQL postgres=# EXPLAIN VERBOSE SELECT "Year", pg.code, "OriginStateName", pg.country_code,my.name from clickhouse_tbl_ontime ch LEFT JOIN pg_tbl_states pg ON pg.name = ch."OriginStateName" LEFT JOIN mysql_tbl_countries my ON pg.country_code = my.code limit 3; QUERY PLAN -> Hash Right Join (cost=10.00..1900.21 rows=5000 width=558) Hash Cond: ((pg.name)::text = ch."OriginStateName") -> Nested Loop Left Join (cost=10.00..1899.09 rows=295 width=532) Join Filter: ((pg.country_code)::text = (my.code)::text) -> Seq Scan on public.pg_tbl_states pg (cost=0.00..1.59 rows=59 width=16) -> Materialize (cost=10.00..1015.00 rows=1000 width=528) -> Foreign Scan on public.mysql_tbl_countries my (cost=10.00..1010.00 rows=1000 width=528) Remote query: SELECT `code`, `name` FROM `db`.`mysql_tbl_countries` -> Hash (cost=0.00..0.00 rows=0 width=36) -> Foreign Scan on public.clickhouse_tbl_ontime ch (cost=0.00..0.00 rows=0 width=36) Output: ch."Year", ch."OriginStateName" Remote SQL: SELECT "Year", "OriginStateName" FROM "default".ontime
  • 14. 14 Push Down – A Performance Feature • Operator and function pushdown • Predicate push down • Aggregate push down • Join push down 14
  • 15. 15 PostgreSQL Foreign Data Wrapper – Operator and Function Pushdown postgres=# EXPLAIN VERBOSE SELECT avg("DepDelay") FROM clickhouse_tbl_ontime WHERE "DepDelay" <10; Foreign Scan (cost=1.00..-1.00 rows=1000 width=32) Output: (avg("DepDelay")) Relations: Aggregate on (clickhouse_tbl_ontime) Remote SQL: SELECT avg("DepDelay") FROM "default".ontime WHERE (("DepDelay" < 10)) (4 rows) 15 postgres=# EXPLAIN VERBOSE SELECT count(*) FROM mysql_tbl_countries WHERE continent_code = 'EU’; Aggregate (cost=1012.50..1012.51 rows=1 width=8) Output: count(*) -> Foreign Scan on public.mysql_tbl_countries (cost=10.00..1010.00 rows=1000 width=0) Output: code, name, full_name, iso3, number, continent_code Local server startup cost: 10 Remote query: SELECT NULL FROM `db`.`mysql_tbl_countries` WHERE ((`continent_code` = 'EU')) (6 rows)
  • 16. 16 PostgreSQL Foreign Data Wrapper – Operator and Function Pushdown postgres=# SELECT count(*) FROM clickhouse_tbl_ontime; count ----------- 184539910 16 postgres=# EXPLAIN VERBOSE SELECT "Year" FROM clickhouse_tbl_ontime WHERE "Year"=1989; QUERY PLAN -------------------------------------------------------------------------------- Foreign Scan on public.clickhouse_tbl_ontime Output: "Year" Remote SQL: SELECT "Year" FROM "default".ontime WHERE (("Year" = 1989) postgres=# SELECT count(*) FROM clickhouse_tbl_ontime WHERE "Year"=1989; count --------- 5041200
  • 17. 17 PostgreSQL Foreign Data Wrapper – JOIN Push Down postgres=# EXPLAIN VERBOSE SELECT a."Year" FROM clickhouse_tbl_ontime a LEFT JOIN clickhouse_tbl_ontime b ON a."Year" = b."Year"; QUERY PLAN Foreign Scan (cost=1.00..1.00 rows=1000 width=50) Output: a."Year" Relations: (clickhouse_tbl_ontime a) LEFT JOIN (clickhouse_tbl_ontime b) Remote SQL: SELECT r1."Year" FROM "default".ontime r1 ALL LEFT JOIN "default".ontime r2 ON (((r1."Year" = r2."Year"))) 17 postgres=# EXPLAIN VERBOSE SELECT a.code FROM mysql_tbl_countries a LEFT JOIN mysql_tbl_countries b ON a.code = b.code; QUERY PLAN Hash Left Join (cost=1032.50..2210.00 rows=5000 width=12) Output: a.code Hash Cond: ((a.code)::text = (b.code)::text) -> Foreign Scan on public.mysql_tbl_countries a (cost=10.00..1010.00 rows=1000 width=12) Output: a.code, a.name, a.full_name, a.iso3, a.number, a.continent_code Local server startup cost: 10 Remote query: SELECT `code` FROM `db`.`mysql_tbl_countries` -> Hash (cost=1010.00..1010.00 rows=1000 width=12) Output: b.code -> Foreign Scan on public.mysql_tbl_countries b (cost=10.00..1010.00 rows=1000 width=12) Output: b.code Local server startup cost: 10 Remote query: SELECT `code` FROM `db`.`mysql_tbl_countries`
  • 18. 18 PostgreSQL Foreign Data Wrapper – Aggregate Push Down postgres=# EXPLAIN VERBOSE SELECT count(*) FROM clickhouse_tbl_ontime; QUERY PLAN ----------------------------------------------------- Foreign Scan (cost=1.00..-1.00 rows=1000 width=8) Output: (count(*)) Relations: Aggregate on (clickhouse_tbl_ontime) Remote SQL: SELECT count(*) FROM "default".ontime (4 rows) 18 postgres=# EXPLAIN VERBOSE SELECT count(*) from mysql_tbl_continents; QUERY PLAN -------------------------------------------------------------------------------------------- Aggregate (cost=1012.50..1012.51 rows=1 width=8) Output: count(*) -> Foreign Scan on public.mysql_tbl_continents (cost=10.00..1010.00 rows=1000 width=0) Output: code, name Local server startup cost: 10 Remote query: SELECT NULL FROM `db`.`mysql_tbl_continents` (6 rows)
  • 19. 19 Other PostgreSQL Foreign Data Wrapper Features • Writeable Foreign Data Wrapper* • Connection Pooling 19
  • 20. 20 Join Us at Percona Live https://www.percona.com/live/19/ Percona Live 2019takes place in Austin, Texas fromMay 28-30,2019atthe Hyatt Regency. Percona Live provides an opportunity to network with peers and technology professionals. Mingle with all types of database community members: DBAs, developers, C-level executives and the latest database technology trend-setters. Dedicated PostgreSQL Tutorials and Breakout Sessions in the PostgreSQLTrack!ADVANCEDRATETICKETSONSALE!
  • 21. 21 About Percona Solutions for your success with MySQL, MariaDB, MongoDB and PostgreSQL Providing support, managed services, consultancy, and software Our software is 100% Open Source and free Support a broad ecosystem – open source databases on premise and in the cloud Founded in 2006 by former MySQL employees, over 170 staff worldwide More than 3000 customers, including top internet companies and enterprises
  • 22. Champions of Unbiased Open Source Database Solutions