{"id":21095002,"url":"https://github.com/wizardjedi/clickhouse-test","last_synced_at":"2026-04-09T08:53:50.260Z","repository":{"id":149277261,"uuid":"81010917","full_name":"wizardjedi/clickhouse-test","owner":"wizardjedi","description":"Yandex ClickHouse database test (clickhouse vs postgresql)","archived":false,"fork":false,"pushed_at":"2017-02-07T15:29:30.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T01:42:40.670Z","etag":null,"topics":["clickhouse","docker","example","postgresql","test","tutorial"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wizardjedi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-05T18:02:11.000Z","updated_at":"2022-06-08T08:00:34.000Z","dependencies_parsed_at":"2023-09-03T11:32:19.700Z","dependency_job_id":null,"html_url":"https://github.com/wizardjedi/clickhouse-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wizardjedi%2Fclickhouse-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wizardjedi%2Fclickhouse-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wizardjedi%2Fclickhouse-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wizardjedi%2Fclickhouse-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wizardjedi","download_url":"https://codeload.github.com/wizardjedi/clickhouse-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243538136,"owners_count":20307104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clickhouse","docker","example","postgresql","test","tutorial"],"created_at":"2024-11-19T22:21:52.276Z","updated_at":"2025-12-29T08:04:21.039Z","avatar_url":"https://github.com/wizardjedi.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Repository for testing Yandex ClickHouse database vs PostgreSQL\n\n# Create containers and import schema to default database\n```\n$ ./prepare.sh\n```\n\n# Generate test data\n```\n$ composer update\n$ php generate-data.php | bzip2 \u003e data.sql.bz2\n```\n\nChange number of days of days, rounds or batch size\n\n# Import data to clickhouse\n\n```\n$ bzcat data.sql.bz2 | ./ch.sh -n\n```\n\n# Import data to PostgreSQL\n\n```\n$ bzcat data.sql.bz2 | ./pg.sh\n```\n\n# Run consoles\n\nRun console for ch in one window\n\n```\n$ ./clickhouse.sh \nClickHouse client version 1.1.54140.\nConnecting to clickhouse-server:9000.\nConnected to ClickHouse server version 1.1.54140.\n\n:) \n```\n\nRun console for pg in other window\n\n```\n$ ./pg.sh \npsql (9.4.8, server 9.5.1)  \nType \"help\" for help.\n\npostgres=# \n```\n\nUse `\\timing` command for psql to turn on timings.\n\n# Try queries\n\n|query|ClickHouse|PostgreSQL|\n|---|---|---|\n|`select count(*) from statistics;`|0.01|0.264|\n|`select count(distinct abonent) from statistics;`|0.051|1.586|\n|`select count(*), count(distinct operator_id), count(distinct region_id), count(distinct abonent), count(distinct send_name_id) from statistics;`|0.111|6.595|\n|`select count(*) from statistics where EventDate\u003e'2016-05-05' and EventDate\u003c'2016-07-05' and partner_id in (1,10,15,25,900);`|0.007|0.52|\n| * ch:`select toMonth(EventDate), sum(sms_send_count), sum(sms_delivered_count) from statistics group by toMonth(EventDate);`|0.047|-|\n| * pg:`select extract(month from EventDate), sum(sms_send_count), sum(sms_delivered_count) from statistics group by extract(month from EventDate);`|-|0.986|\n|`select region_id, sum(sms_send_count) from statistics group by region_id order by count(*) limit 10;`|0.028|0.688|\n|`select count(distinct abonent), region_id, count(*) from statistics group by region_id having count(*) \u003e 5000 order by count(*) desc limit 10;`|0.133|3.613|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwizardjedi%2Fclickhouse-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwizardjedi%2Fclickhouse-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwizardjedi%2Fclickhouse-test/lists"}