I was looking at the query log and noticed:
- the additional_info field is only used for regex blacklist entries (and cname data), all other (white and black) list entries never get additional info.
- although I have several blacklist regexes, from lists such as mmotti, adguardteam, nextdns, ... ,very few entries appear in the additional_field (thus never triggered by a query).
Looking at the results (grafana):
same can be achieved with this query (It may not be wise to run this if you don't have a MAXDBDAYS setting, limiting the number of entries in the database, I use MAXDBDAYS=8):
pihole-FTL sqlite3 ".timeout = 5000" ".headers on" ".mode column" \
"ATTACH '/etc/pihole/pihole-FTL.db' AS pihole_FTL" \
"ATTACH '/etc/pihole/gravity.db' AS gravity" \
"SELECT count(pihole_FTL.queries.additional_info), gravity.domainlist.id, gravity.domainlist.domain FROM pihole_FTL.queries \
INNER JOIN gravity.domainlist \
ON pihole_FTL.queries.additional_info = gravity.domainlist.id \
WHERE typeof(additional_info) = 'integer' \
GROUP BY additional_info ORDER BY count(additional_info) DESC;"
I was wondering if it would make sense to ensure the regexes with the highest count appear first in the list (e.g. id 1 -> .*;querytype=!A , id 2 -> ^(.+\.)?(facebook|fb(cdn|sbx)?|tfbnw)\.[^.]+$ , ...), may be wrong here...
I assume pihole-FTL loads (compiles) the regexes, as read from the database (in that order) and looks for a match. once a regex matches, regex processing stops. Putting the most used regex first, might speed up FTL (to be confirmed by DL6ER?)


