we have a quite powerful PostgreSQL-Instance running in a Kubernetes cluster with actually quite low usage. We are facing the problem that every fifth/sixth/seventh time we run the query it is significantly slower (5s instead of 100ms). You can find an example query, but we are facing the same problem with several other queries as well. The query planner (EXPLAIN ANALYSE) show all the time the same execution plan.
SELECT count(*) AS "count"
FROM "administrative_areas"."flurstuecke" AS "flurstuecke"
WHERE "flurstuecke"."flur_id" = 8554
Our storage is based on Netapp and integrated into Kubernetes with Trident. We can not see any high IOPS values, high CPU load or memory consumption.
Does anyone have an idea or can point us in the right direction?