postgresql - 我应该从 PostgreSQL search_path 中删除 "$user"吗?

标签 postgresql optimization configuration

search_path 的默认设置是 "$user",public。根据manual :

The first element specifies that a schema with the same name as the current user is to be searched. If no such schema exists, the entry is ignored.

什么时候会检查 $user 模式是否存在?在 session 开始时?或者可能每次需要解决一个不合格的对象?如果我知道我只会在数据库中使用“公共(public)”模式,删除“$user”条目是否有意义?

我意识到这两种方式都不会在性能上产生明显的差异,但它可能会使设置更加明确......为什么在 search_path 中有一些永远不会被使用的东西?

最佳答案

如果你

know that I will only ever be using the "public"

.. 从 search_path 中删除 $user 非常有意义。你不会从中得到任何好处。
无论如何,我在所有集群中都这样做。

关于postgresql - 我应该从 PostgreSQL search_path 中删除 "$user"吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15453128/

相关文章:

SQL:创建具有枚举列的外部表时出错

psql 中的 postgresql 日志消息

java - 如何优化我编写的以下java代码来生成下一个回文数

testing - Oozie:在本地测试工作流程

用于容纳应用程序配置的 Azure 表存储

sql - 插入 postgres 不工作

c++ - "variable tracking"占用了我的编译时间!

c# - .NET CLR VM 中的逃逸分析

variables - systemd:在单元文件中使用变量

postgresql - Peewee:怎么做 ORDER BY ... NULLS (FIRST|LAST)?