Skip to content

Log slow queries (when creating a new shape) #2437

@KyleAMathews

Description

@KyleAMathews

Electric initializes a new shape by running a query. It streams the results back to the client and also to disk to start the shape log. Subsequent requests are resolved from disk so much faster.

Some shape initializations can be quite slow for normal SQL select reasons e.g. it's returning lots of rows, the where clause isn't against an index so it requires a full table scan, etc.

To make this clear — we should log whenever a query takes more than perhaps 1s with the duration, the shape definition / url, and the query that Electric runs.

Then people can run the query directly against PG to debug why it's running slow.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions