Performance improvements for executions count on Postgres (#1888)

* Performance improvements for executions count on Postgres

As reported by a community member https://community.n8n.io/t/stress-load-testing/4846/5
and https://github.com/n8n-io/n8n/issues/1578, when using postgres with
a big volume of executions, the executions list's performance degrades.

This PR is aimed at Postgres specifically by querying postgres' stats
collector instead of running a full table scan, providing a good
estimate.

More can be read here: https://www.citusdata.com/blog/2016/10/12/count-performance/

* Removed order of magnitude so we display closer numbers

* Making count based on statistics only when not applying filters

*  Minor styling improvements

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Omar Ajoue
2021-07-06 23:25:25 +02:00
committed by GitHub
parent 297d9fe77d
commit 8d235e94cb
4 changed files with 50 additions and 9 deletions

View File

@@ -325,6 +325,7 @@ export interface IExecutionShortResponse {
export interface IExecutionsListResponse {
count: number;
results: IExecutionsSummary[];
estimated: boolean;
}
export interface IExecutionsCurrentSummaryExtended {