Examples of Writable Common Table Expressions in PostgreSQL
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Gemfile
Gemfile.lock
README.md
master_detail_bench.rb
merge_naive.rb
merge_sql.rb
structure.sql

README.md

Setup

From the writable-cte-examples directory:

bundle

Assuming you have a local PostgreSQL install run the following:

createdb writable_cte_bench
psql writable_cte_bench < structure.sql

If your PostgreSQL server is not on your local machine you will also need to adjust the connection settings in writable_cte_bench.rb

Running Benchmarks

bundle exec ruby writable_cte_bench.rb
bundle exec time ruby merge_naive.rb
bundle exec time ruby merge_sql.rb