Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iNishant committed Sep 19, 2024
1 parent 0aef48b commit c3b76f2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Django Querysets Single Query Fetch

Executes multiple querysets over a single db query and returns results which would have been returned in normal evaluation of querysets. This can help in critical paths to avoid network/connection-pooler latency if db cpu/mem are nowhere near exhaustion. Ideal use case is fetching multiple small and optimised independent querysets where above mentioned latencies can dominate total execution time.
Executes multiple querysets over a single db query and returns results which would have been returned in normal evaluation of querysets. This can help in critical paths to avoid network latency. Ideal use case is fetching multiple small and optimised independent querysets where above mentioned latencies can dominate total execution time.

Supports only Postgres as of now

Expand Down
2 changes: 1 addition & 1 deletion django_querysets_single_query_fetch/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _get_fetch_count_compiler_from_queryset(
slightly modified copy paste from get_count and get_aggregation in django.db.models.sql.compiler
"""
obj = queryset.query.clone()
obj.add_annotation(Count("*"), alias="__count", is_summary=True)
obj.add_annotation(Count("*"), alias="__count")
added_aggregate_names = ["__count"]
existing_annotations = [
annotation
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
django==4
django==4.2
psycopg2==2.9.9
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setuptools.setup(
name="django_querysets_single_query_fetch",
version="0.0.11",
version="0.0.12",
description="Execute multiple Django querysets in a single SQL query",
long_description="Utility which executes multiple Django querysets over a single network/query call and returns results which would have been returned in normal evaluation of querysets",
author="Nishant Singh",
Expand Down

0 comments on commit c3b76f2

Please sign in to comment.