Improve gravity on systems with low memory (#5977)

This commit is contained in:
Dominik 2025-02-28 17:02:56 +01:00 committed by GitHub
commit 53e241f057
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -92,7 +92,8 @@ gravity_build_tree() {
echo -ne " ${INFO} ${str}..."
# The index is intentionally not UNIQUE as poor quality adlists may contain domains more than once
output=$({ pihole-FTL sqlite3 -ni "${gravityTEMPfile}" "CREATE INDEX idx_gravity ON gravity (domain, adlist_id);"; } 2>&1)
# We use temp_store = FILE to avoid memory exhaustion on large databases
output=$({ pihole-FTL sqlite3 -ni "${gravityTEMPfile}" "PRAGMA temp_store = FILE; CREATE INDEX idx_gravity ON gravity (domain, adlist_id);"; } 2>&1)
status="$?"
if [[ "${status}" -ne 0 ]]; then