We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The postgresql destination plugin deletes stale records like this:
cloudquery/plugins/destination/postgresql/client/delete.go
Lines 18 to 25 in f649bed
The filter on _cq_source_name and _cq_sync_time requires a sequential scan of the table because these fields aren't indexed:
_cq_source_name
_cq_sync_time
explain delete from "gcp_compute_instances" where _cq_source_name = 'foo' and _cq_sync_time < now(); QUERY PLAN ------------------------------------------------------------------------------- Delete on gcp_compute_instances (cost=0.00..20059.78 rows=0 width=0) -> Seq Scan on gcp_compute_instances (cost=0.00..20059.78 rows=2 width=6) Filter: ((_cq_source_name = 'foo'::text) AND (_cq_sync_time < now())) (3 rows)
On tables with several sources, this could be slow. It seems like it could benefit from an index.
Create indexes on _cq_source_name and _cq_sync_time.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Which problem is this feature request solving?
The postgresql destination plugin deletes stale records like this:
cloudquery/plugins/destination/postgresql/client/delete.go
Lines 18 to 25 in f649bed
The filter on
_cq_source_name
and_cq_sync_time
requires a sequential scan of the table because these fields aren't indexed:On tables with several sources, this could be slow. It seems like it could benefit from an index.
Describe the solution you'd like
Create indexes on
_cq_source_name
and_cq_sync_time
.Pull request (optional)
The text was updated successfully, but these errors were encountered: