Pi-hole keeps a long-term history of your DNS queries, and the default is longer than I’d guess most people expect. If you’d rather keep a month, or nothing, it is one setting.
sudo pihole-FTL --config database.maxDBdays 30
According to the FTL docs, database.maxDBdays is how long queries are stored in the database, in days. The default is 91, and 0 disables the database altogether. In a Docker Compose file the same setting is FTLCONF_database_maxDBdays.
Next to it sits database.DBinterval, how often queries are written to the database. Its default is 60 seconds.
Two things to keep in mind. With 0 there is no database, so the long-term graphs and history have nothing to show. And the docs only describe the setting as the retention time. I haven’t seen them say what happens to older rows right after you lower the number, so don’t count on a quick cleanup of an existing file.
The docs list two more keys in the same section. database.DBimport says whether FTL loads information from the database on startup to know the most recent history, and it defaults to true. database.network.expire is how long IP addresses are kept in the network_addresses table, in days, also with a default of 91. The page documents only the write syntax of pihole-FTL --config, such as sudo pihole-FTL --config dns.dnssec true. To see the current value, the docs point you to /etc/pihole/pihole.toml.
Further reading: Pi-hole docs: FTL configuration