Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/totalcount' into dev
Browse files Browse the repository at this point in the history
altergui committed Aug 9, 2024
2 parents e9744d3 + fc1d81e commit 87951d8
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions vochain/indexer/db/processes.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions vochain/indexer/queries/processes.sql
Original file line number Diff line number Diff line change
@@ -129,12 +129,13 @@ SELECT COUNT(DISTINCT entity_id) FROM processes;

-- name: SearchEntities :many
WITH results AS (
SELECT *,
COUNT(*) OVER() AS total_count
SELECT *
FROM processes
WHERE (sqlc.arg(entity_id_substr) = '' OR (INSTR(LOWER(HEX(entity_id)), sqlc.arg(entity_id_substr)) > 0))
)
SELECT entity_id, COUNT(id) AS process_count, total_count
SELECT entity_id,
COUNT(id) AS process_count,
COUNT(entity_id) OVER() AS total_count
FROM results
GROUP BY entity_id
ORDER BY creation_time DESC, id ASC

0 comments on commit 87951d8

Please sign in to comment.