A benchmark runner for PostgreSQL relations with and without indexes
- Node.js
- A PostgreSQL database
git clone https://github.com/loderunner/postgresql-index-benchmark.git
npm install
Configure your environment by setting your database URL:
Create a .env
file at the root of your repository, and set the DATABASE_URL
variable to a PostgreSQL connection URL:
DATABASE_URL=postgresql://postgres:password@localhost:5432/postgresql-index-benchmark?connection_limit=20&pool_timeout=0
Configure your environment variable directly in your shell:
export DATABASE_URL="postgresql://postgres:password@localhost:5432/postgresql-index-benchmark?connection_limit=20&pool_timeout=0"
Migrate the database to match the benchmark schema, and generate the Prisma client:
npx prisma migrate dev
Run the benchmark:
node .