Project

General

Profile

Actions

Improvements #12117

open

Improve `createQueryCountSql`

Added by Matthias Van Ceulebroeck 6 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Start date:
11/06/2023
Due date:
% Done:

0%

Estimated time:

Description

This query is used alongside the actual query to retrieve the number of results. Generally this should be a query that is performed faster than the actual query.

However, currently this takes the whole query, and performs a SELECT COUNT(1) FROM with a subquery. This subquery is the original query, with all its selects. This results in a suboptimal query, where more data is actually fetched than is necessary, causing slower queries. This should be optimised such that the unnecessary selects are removed, and we perform a SELECT COUNT(1) on the original query directly, instead of using it as a subquery.

No data to display

Actions

Also available in: Atom PDF