Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instead of selecting the whole data, just count it #2263

Merged
merged 3 commits into from
Sep 4, 2016
Merged

Conversation

j0k3r
Copy link
Member

@j0k3r j0k3r commented Sep 3, 2016

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Documentation no
Translation no
Fixed tickets
License MIT

Instead of performing a complex select (to retrieve all data for entry, etc...) just select the counter and retrieve it.

Down from ~50ms to ~30ms on the unread page (with 500 items)

Instead of performing a complex select (to retrieve all data for entry, etc...) just select the counter and retrieve it.

Down from ~50ms to ~30ms on the unread page (with 500 items)
@j0k3r j0k3r added this to the 2.1.0 milestone Sep 3, 2016
@j0k3r
Copy link
Member Author

j0k3r commented Sep 3, 2016

ERROR: column "e0_.id" must appear in the GROUP BY clause or be used in an aggregate function

F*** Y** PostgreSQL.

Twig Global function are called globally. This means even on a query to the api.

Using a function we can decide when we want to call it.

Also, remove previous `COUNT(e.id)` since it doesn't work on PostgreSQL ...
@nicosomb
Copy link
Member

nicosomb commented Sep 3, 2016

No more cache for these queries?

@j0k3r
Copy link
Member Author

j0k3r commented Sep 4, 2016

@nicosomb the cache is still here.

@nicosomb
Copy link
Member

nicosomb commented Sep 4, 2016

OK, but not used, right? (it's just to know :) )

@j0k3r
Copy link
Member Author

j0k3r commented Sep 4, 2016

Since all config about caching (ie: result_cache_driver etc.) aren't enable in config_*, nop it's not used.

@nicosomb
Copy link
Member

nicosomb commented Sep 4, 2016

👍

@j0k3r j0k3r merged commit c3b5318 into 2.1 Sep 4, 2016
@j0k3r j0k3r deleted the speed-up-count branch September 4, 2016 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants