We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8bb5b4 commit e9e9a2cCopy full SHA for e9e9a2c
website/views/core.py
@@ -799,7 +799,9 @@ def search(request, template="search.html"):
799
result_count = 0
800
801
# Get result counts from context if available
802
- # Use len() instead of .count() to avoid additional DB queries on sliced querysets
+ # Use len() instead of .count() on sliced querysets:
803
+ # .count() on a sliced queryset first evaluates the slice and then counts,
804
+ # making it redundant and potentially slower than just using len().
805
try:
806
if search_type == "all" or not search_type:
807
# Sum counts from all search results
0 commit comments