Skip to content

Commit

Permalink
Refactor query for retrieving active index creation queries
Browse files Browse the repository at this point in the history
  • Loading branch information
MXPOL committed Apr 9, 2024
1 parent a383aa3 commit 14432b3
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions libs/external-db-postgres/src/postgres_index_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ export default class IndexProvider implements IIndexProvider {
FROM pg_stat_activity
WHERE
(query ILIKE 'CREATE INDEX%' OR query ILIKE 'CREATE UNIQUE INDEX%')
-- get only the queries that are creating indexes on collectionName table
AND (query LIKE '%${escapeIdentifier(collectionName)}(%')
-- get only the queries that are active
AND state = 'active'
GROUP BY query;
`
Expand Down

0 comments on commit 14432b3

Please sign in to comment.