Hello Lukas,

On Tue, Sep 11, 2012 at 5:22 PM, Lukas Eder <[email protected]> wrote:

> Hello Sergey
>
> > 1. We have operation that executes select query and do pagination logic.
> >     public static <T> SearchResult<T> executeSearch(Class<? extends T>
> > clazz, SearchParameters params,
> >                                                     SelectQuery
> selectQuery,
> > SelectQuery countQuery);
> > [...]
>
> Have you considered using analytical functions for the count? I.e.
>
> - Factory.count().over()
> - Factory.count().over().partitionByOne()
>
> The second one is equivalent to the first one, but more expressive.
> That could save you the extra round-trip for the count query.
> Specifically for complex execution plans, Analytical functions might
> prove to be much more performant compared to separate query
> executions.
>

Thank you, good hint.

--
Best regards,
Sergey

Reply via email to