beholder icon indicating copy to clipboard operation
beholder copied to clipboard

remove ordering from count query

Open mfedortsov opened this issue 7 years ago • 5 comments

Split query by 2 part:

  1. query for data contains ordering
  2. query for count contains no ordering.

mfedortsov avatar Mar 07 '17 15:03 mfedortsov

What is motivation for this change? Is there any perfmance gain?

romanowski avatar Mar 07 '17 16:03 romanowski

I found interesting query from our servers. Yes, it will improve performance for some queries, especially if query contains several left joins inside.

mfedortsov avatar Mar 07 '17 16:03 mfedortsov

LGTM! The idea to not sort data when we only need a count of the items seems to be a reasonable approach.

liosedhel avatar Apr 17 '17 19:04 liosedhel

@mfedortsov Could you make a PR against the branch 1.1.x (with slick 3.0.3) also? (I will merge the 1.1.x branch into the master soon).

liosedhel avatar Apr 17 '17 19:04 liosedhel

:+1:

pdolega avatar Apr 20 '17 04:04 pdolega