jackc / jackc/pgx

Optimize batch inserts with ReWriteBatchedInserts

Open
#1,637 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
14.3k
Forks
1.1k
Avg merge
6d 9h
Merged PRs (30d)
11

Description

Is your feature request related to a problem? Please describe.
Single query is more performant than batch query for large multi-insert: https://www.postgresql.org/message-id/55130DC8.2070508@redhat.com

Describe the solution you'd like
Rewrite batch queries to single query when an optional flag ReWriteBatchedInserts is set.

Additional context
Similar feature exist in pgjdbc driver: https://github.com/pgjdbc/pgjdbc/pull/491

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked pgjdbc PR #491 and PostgreSQL performance discussion first to understand the requested rewrite semantics and optional flag. No pgx files or tests are named, so locate the batch-insert path and add coverage for rewritten and unchanged queries; done means the feature works and its tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.