https://github.com/loderunner/postgresql-index-benchmark
A benchmark runner for PostgreSQL relations with and without indexes
https://github.com/loderunner/postgresql-index-benchmark
Last synced: 6 months ago
JSON representation
A benchmark runner for PostgreSQL relations with and without indexes
- Host: GitHub
- URL: https://github.com/loderunner/postgresql-index-benchmark
- Owner: loderunner
- License: apache-2.0
- Created: 2023-01-06T13:17:07.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-09T14:47:30.000Z (about 3 years ago)
- Last Synced: 2025-06-10T02:40:45.250Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# postgresql-index-benchmark
A benchmark runner for PostgreSQL relations with and without indexes
## Prerequisites
* [Node.js](https://nodejs.org/)
* A [PostgreSQL](https://www.postgresql.org/) database
## Setup
### Clone the repository
```shell
git clone https://github.com/loderunner/postgresql-index-benchmark.git
```
### Install dependencies
```shell
npm install
```
### Environment
Configure your environment by setting your database URL:
#### .env file
Create a `.env` file at the root of your repository, and set the `DATABASE_URL` variable to a PostgreSQL connection URL:
```dotenv
DATABASE_URL=postgresql://postgres:password@localhost:5432/postgresql-index-benchmark?connection_limit=20&pool_timeout=0
```
#### Shell variables
Configure your environment variable directly in your shell:
```shell
export DATABASE_URL="postgresql://postgres:password@localhost:5432/postgresql-index-benchmark?connection_limit=20&pool_timeout=0"
```
### Migrate database and generate client
Migrate the database to match the benchmark schema, and generate the [Prisma](https://www.prisma.io/) client:
```shell
npx prisma migrate dev
```
## Run
Run the benchmark:
```shell
node .
```