Skip to content

Instantly share code, notes, and snippets.

@dvdbng
dvdbng / bench_pg_array.py
Created February 9, 2017 22:11 — forked from xflr6/bench_pg_array.py
Benchmark PostgreSQL array vs. join performance
# bench_pg_array.py - benchmark postgresql array vs. join performance
"""
Replicate http://shon.github.io/2015/12/21/postgres_array_performance.html
with proper join table indexes (uniqueness constraints) using sqlalchemy.
$ python -i bench_pg_array.py
>>> setup()
$ python -m timeit -s "import bench_pg_array" "bench_pg_array.test_join()"