我正在使用 kubernethese 和 postgresql docker 容器,我正在尝试分析一些查询的性能,例如:
explain (analyze, buffers) select * from table1 as t1, table2 as t2 where t1.id = t2.id and t1.status=true and t2.status=true
我发现每次执行后查询都指向内存缓存。如何清除docker容器中的postgresql缓存?
如果您只是想衡量性能,但它不是生产数据库,则可以停止 pod 并重新启动它。使用卷确保数据库具有持久性,然后只需执行kubectl delete pod <name of the pod>
. 如果您使用的是 Deployments 或 DaemonSets,那么 pod 应该以缓存清理再次启动。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句