Skip to content

UI unresponsive when using insert batchingΒ #257

@kitu-sbruce

Description

@kitu-sbruce

Hello,

I've got PoWA running locally to Postgres and as part of some performance enhancements to our application we've implemented batching of inserts. Batching is setup in such a way that we batch up to 1000 records or wait 5 seconds to force a batch. The majority batches are 1000 records but given the time element we could have the same query repeated up to 1000 times. This is causing the Web UI to lock up and be unusable.

Perhaps there is a simple solution here but in the event there isn't wanted to pitch an idea. Rather than sending the query over the the /database_all_queries API response could only the query ID and a reference to a pre-generated/cached image of the query be included? The WebUI would show the image by default and then hovering or maybe clicking some button could get the individual query from another API endpoint. Sure an image is more data over the wire but it would reduce CPU usage on the client.

Example insert:

CREATE TABLE pg_temp.numbers (n BIGINT);

-- the app has a dynamic batching based on whatever rules
-- Query 1: Batch size: 3
INSERT INTO pg_temp.numbers (n)
VALUES ($1), ($2), ($3)
;

-- Query 2: Batch size: 1
INSERT INTO pg_temp.numbers (n)
VALUES ($1)
;

PoWA Web Version 5.0.1

Thanks πŸ˜„

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions