• Stars
    star
    202
  • Rank 193,691 (Top 4 %)
  • Language
    C
  • License
    Other
  • Created over 5 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PostgreSQL's Foreign Data Wrapper For ClickHouse

What is clickhousedb_fdw? *

The clickhousedb_fdw is open-source. It is a Foreign Data Wrapper (FDW) for one of the fastest column store databases; "Clickhouse". This FDW allows you to SELECT from, and INSERT into, a ClickHouse database from within a PostgreSQL server. The FDW supports advanced features like aggregate pushdown and joins pushdown. These significantly improve performance by utilizing the remote server’s resources for these resource intensive operations.

Documentation

  1. Supported PostgreSQL Versions
  2. Installation
  3. Setup
  4. User Guide
  5. Release Notes
  6. License
  7. Submitting Bug Reports
  8. Copyright Notice

Supported PostgreSQL Versions

The clickhousedb_fdw should work on the latest version of PostgreSQL but is only tested with these PostgreSQL versions:

Distribution Version Supported
PostgreSQL Version < 11 ❌
PostgreSQL Version 11 βœ”οΈ
PostgreSQL Version 12 βœ”οΈ
PostgreSQL Version 13 βœ”οΈ
Percona Distribution Version < 11 ❌
Percona Distribution Version 11 βœ”οΈ
Percona Distribution Version 12 βœ”οΈ
Percona Distribution Version 13 βœ”οΈ

Installation

Installing from source code

You can download the source code of the latest release of clickhousedb_fdw from this GitHub page or using git:

git clone git://github.com/Percona-Lab/clickhousedb_fdw.git

Compile and install the extension

cd clickhousedb_fdw
make USE_PGXS=1
make USE_PGXS=1 install

Create the extension using the CREATE EXTENSION command.

CREATE EXTENSION clickhousedb_fdw;
CREATE EXTENSION
Install using deb / rpm packages.
sudo yum install clickhousedb_fdw
sudo apt-get install clickhousedb_fdw
CREATE SERVER clickhouse_svr
FOREIGN DATA WRAPPER clickhousedb_fdw 
OPTIONS(dbname 'test_database', driver '/home/vagrant/percona/clickhousedb_fdw/lib/clickhouse-odbc/driver/libclickhouseodbc.so', host '127.0.0.1');
   
CREATE USER MAPPING FOR CURRENT_USER SERVER clickhouse_svr;

CREATE FOREIGN TABLE tax_bills_nyc 
    (
        bbl int8,
        owner_name text,
        address text,
        tax_class text,
        tax_rate text,
        emv Float,
        tbea Float,
        bav Float,
        tba text,
        property_tax text,
        condonumber text,
        condo text,
        insertion_date Time 
    ) SERVER clickhouse_svr;

SELECT bbl,tbea,bav,insertion_date FROM tax_bills_nyc LIMIT 5;
        bbl     | tbea  |  bav   | insertion_date 
    ------------+-------+--------+----------------
    4001940057 | 18755 | 145899 | 15:25:42
    1016830130 |  2216 |  17238 | 15:25:42
    4012850059 | 69562 | 541125 | 15:25:42
    1006130061 | 55883 | 434719 | 15:25:42
    3033540009 | 33100 | 257490 | 15:25:42
    (5 rows)
    
CREATE TABLE tax_bills ( bbl bigint, owner_name text) ENGINE = MergeTree PARTITION BY bbl ORDER BY (bbl)
    
INSERT INTO tax_bills SELECT bbl, tbea from tax_bills_nyc LIMIT 100;
    
EXPLAIN VERBOSE SELECT bbl,tbea,bav,insertion_date FROM tax_bills_nyc LIMIT 5;
                                         QUERY PLAN                                         
    --------------------------------------------------------------------------------------------
    Limit  (cost=0.00..0.00 rows=1 width=32)
    Output: bbl, tbea, bav, insertion_date
     ->  Foreign Scan on public.tax_bills_nyc  (cost=0.00..0.00 rows=0 width=32)
             Output: bbl, tbea, bav, insertion_date
             Remote SQL: SELECT bbl, tbea, bav, insertion_date FROM test_database.tax_bills_nyc
    (5 rows)

To learn more about Percona-Lab/clickhousedb_fdw configuration and usage, see User Guide.

Submitting Bug Reports

If you found a bug in clickhousedb_fdw, please submit the report to the Jira issue tracker

Start by searching the open tickets for a similar report. If you find that someone else has already reported your issue, then you can upvote that report to increase its visibility.

If there is no existing report, submit your report following these steps:

Sign in to Jira issue tracker. You will need to create an account if you do not have one.

In the Summary, Description, Steps To Reproduce, Affects Version fields describe the problem you have detected.

As a general rule of thumb, try to create bug reports that are:

  • Reproducible: describe the steps to reproduce the problem.

  • Unique: check if there already exists a JIRA ticket to describe the problem.

  • Scoped to a Single Bug: only report one bug in one JIRA ticket.

Copyright Notice

Portions Copyright Β© 2018-2020, Percona LLC and/or its affiliates

Portions Copyright Β© 2019-2020, Adjust GmbH

Portions Copyright Β© 1996-2020, PostgreSQL Global Development Group

Portions Copyright Β© 1994, The Regents of the University of California

  • Master branch is under heavy development phase, you may face some compilation issues. The REL_0_1_ still can be used.

More Repositories

1

tpcc-mysql

C
455
star
2

sysbench-tpcc

Sysbench scripts to generate a tpcc-like workload for MySQL and PostgreSQL
Lua
292
star
3

mysql_random_data_load

MySQL random data loader
Go
283
star
4

mongodb_consistent_backup

A tool for performing consistent backups of MongoDB Clusters or Replica Sets
Python
273
star
5

PromHouse

PromHouse is a long-term remote storage with built-in clustering and downsampling for Prometheus 2.x on top of ClickHouse.
Go
259
star
6

query-playback

Query Playback
C++
95
star
7

ontime-airline-performance

Shell
95
star
8

pacemaker-replication-agents

Repository of the Percona Pacemaker resource agents
Shell
77
star
9

percona-openshift

Set of scripts to run Percona software in OpenShift / Kubernetes
Shell
54
star
10

proxysql-docker

Shell
44
star
11

pxc-docker

All docker related code for PXC
Shell
39
star
12

coredumper

Google coredumper library
C
38
star
13

tuned-percona-mongodb

A performance-focused tuned profile for MongoDB on CentOS/Redhat Linux
Makefile
37
star
14

pxc-proxysql-k8s

Shell
32
star
15

benchmark-results

23
star
16

jenkins-pipelines

Groovy
21
star
17

percona-xtradb-cluster-docker

Shell
21
star
18

tpce-mysql

C++
20
star
19

grafana_mongodb_dashboards

Dashboard for using Grafana and prometheus_mongodb_exporter
17
star
20

prom-migrate

prom-migrate reads all data from Prometheus 1.8 via API and creates a new Prometheus 2.0 storage directory.
Go
16
star
21

sysbench-mongodb-lua

Lua
14
star
22

serverless-postgresql-build

Shell
13
star
23

pmm-submodules

A repo dedicated to building Percona Monitoring and Management (PMM)
Python
12
star
24

pt-mysql-config-diff

A tool like pt-config-diff written in Go
Go
11
star
25

terraform-provider-percona

Terraform modules to deploy Percona Server and Percona XtraDB Cluster
Go
11
star
26

pt-pmp

Shell
10
star
27

go-tpcc

Go
10
star
28

pmm-custom-queries

Custom queries for Percona Monitoring and Management (PMM)
Shell
9
star
29

proxysql-ha-experiments

Shell
8
star
30

slowlog2clickhouse

Parse MySQL Slow log and save into ClickHouse table
Go
8
star
31

tokumx2_to_psmdb3_migration

Instructions and scripts to facilitate migration from TokuMX 2.0.x to PSMDB 3.0.x
JavaScript
7
star
32

percona-images

Packer config to build Percona base boxes
Shell
7
star
33

libeatmydata

libeatmydata library and packaging
M4
7
star
34

k8s-lab

HCL
6
star
35

autotokubackup

AutoTokBackup: A tokubackup commandline tool for running Percona TokuBackup written in Python3
Python
6
star
36

ognom-toolkit

Go
5
star
37

mysql-group-replication-docker

Shell
5
star
38

mysql-configs

5
star
39

percona-dbaas-cli

Go
5
star
40

percona-binlog-server

Percona Binary Log Server
C++
5
star
41

percona-millipede

Multi-host, sub-second replication delay monitor
Python
4
star
42

ps-build

Collection of MySQL build scripts
Shell
4
star
43

proxysql-scheduler

Shell
4
star
44

pmm-ruled

Rules Daemon
Go
4
star
45

group_replication_tools

4
star
46

mnogo_exporter

Moved to https://github.com/percona/mongodb_exporter (branch exporter_v2)
Go
4
star
47

percona-version-service

Go
3
star
48

pt-mongodb-summary

pt-mongodb-summary
Go
3
star
49

toolkit-tests

Docker container to run Percona Toolkit tests
Shell
3
star
50

minimum_permissions

Get the minimum set of permissions needed to run a particular query
Go
3
star
51

MetricBench

C++
3
star
52

serverless-postgresql-ansible

Ansible playbook to deploy serverless PostgreSQL
Jinja
3
star
53

codeceptjs-saucehelper

CodeceptJS Sauce Labs helpers, to update Test Names, Test Results after test execution
JavaScript
2
star
54

codeceptjs-influxdbhelper

CodeceptJS helper to collect Test Execution Metrics with the help of CodeceptJS test events
JavaScript
2
star
55

text2json

POC for a text (pt-summary / pt-mysql-summary) reports to json converter
Go
2
star
56

sysbench-blob

Lua
2
star
57

PLG

Recording and replaying exporters
Go
2
star
58

redo_log_dumper

POC for a innodb redo log dumper
Go
2
star
59

mongodb-fingerprint

Go
2
star
60

pmm-dashboards

PMM compatible dashboards or dashboards done during webinars or presentations
Shell
2
star
61

pmm-api

Moved to https://github.com/percona/pmm
HTML
2
star
62

benchmark_automation

Scripts to help automate the running of repeatable benchmarks
Shell
2
star
63

mongodb_systemd_multi

Setup of script for multiple instances in a single host for mongodb (designed for testing) or systemd mongo for mongos, arbiters, config servers and mongod's
Shell
2
star
64

wsrpc

Early prototype; dead end
Go
2
star
65

pmm-workloads

Various Workloads to Test and Demo Percona Monitoring and Management (PMM)
PHP
2
star
66

star-schema-benchmark

Scala
1
star
67

sanitizer

POC for a log sanitizer for pt-stalk, pt-mysql-summary, pt-summary
Go
1
star
68

operator-env

Go
1
star
69

sst-bench

Shell
1
star
70

vitess-tpcc-lab

Lua
1
star
71

percona-server-mongodb-openshift

Shell
1
star
72

wikistat-data

Python
1
star
73

mysql-kubernetes-openshift

1
star
74

pmm-client-docker

Shell
1
star
75

install-repo-pmm-server

Shell
1
star
76

pmm-api-tests

API tests for PMM 2.x.
Go
1
star
77

eng-scripts

Scripts from MySQL Engineering Team
Shell
1
star
78

pmm-build

Early prototype; dead end
Go
1
star
79

percona-mixins

Jsonnet
1
star
80

percona-on-arm

Unofficial builds
Shell
1
star
81

sysbench-mongodb-loop

A wrapper to run sysbench-mongodb forever
Shell
1
star
82

procfs

C++
1
star
83

visualize-mysql-queries

visualize mysql queries (based on Performance Schema)
JavaScript
1
star
84

rdsosmetrics_exporter

PROOF OF CONCEPT! export RDS Enhanced Monitoring metrics from CloudWatch Logs for prometheus
Go
1
star
85

MyRocks-benchmark

Scripts used too perform MyRocks specific benchmarks, forked from mdcallag/sysbench
1
star
86

single_install

This repo provides a single click installation script to Percona Products
Shell
1
star
87

qa-integration

Integration Tests Repo for Percona QA cross product common tests for release Integration testing
Shell
1
star