https://github.com/SoftwareHeritage/swh-storage
Revision 88ff2c2fa0ec61310071ea40b83079fb333aac99 authored by Antoine Lambert on 03 March 2021, 15:20:39 UTC, committed by Antoine Lambert on 03 March 2021, 16:49:20 UTC
With small limits (< 10), the snapshot branches query can degenerate into
using the deduplication index on snapshot_branch (name, target, target_type),
and the postgresql planner happily scans several hundred million rows.

So ensure a minimum limit value of 10 before executing the query for
optimal performances when a small branches_count value is provided
to the snapshot_get_branches method of the Storage interface.

Related to P966
1 parent ce8335d
History
Tip revision: 88ff2c2fa0ec61310071ea40b83079fb333aac99 authored by Antoine Lambert on 03 March 2021, 15:20:39 UTC
postgresql: Ensure a minimum limit for the snapshot branches query
Tip revision: 88ff2c2
File Mode Size
bin
docs
sql
swh
.gitignore -rw-r--r-- 136 bytes
.pre-commit-config.yaml -rw-r--r-- 1.2 KB
AUTHORS -rw-r--r-- 112 bytes
CODE_OF_CONDUCT.md -rw-r--r-- 3.3 KB
CONTRIBUTORS -rw-r--r-- 46 bytes
LICENSE -rw-r--r-- 34.3 KB
MANIFEST.in -rw-r--r-- 242 bytes
Makefile -rw-r--r-- 163 bytes
Makefile.local -rw-r--r-- 69 bytes
README.md -rw-r--r-- 4.9 KB
conftest.py -rw-r--r-- 323 bytes
mypy.ini -rw-r--r-- 1.3 KB
pyproject.toml -rw-r--r-- 237 bytes
pytest.ini -rw-r--r-- 395 bytes
requirements-swh-journal.txt -rw-r--r-- 21 bytes
requirements-swh.txt -rw-r--r-- 68 bytes
requirements-test.txt -rw-r--r-- 291 bytes
requirements.txt -rw-r--r-- 129 bytes
setup.cfg -rw-r--r-- 247 bytes
setup.py -rwxr-xr-x 2.4 KB
tox.ini -rw-r--r-- 682 bytes

README.md

back to top