gpt4 book ai didi

ruby-on-rails - 如何去除 postgresql 噪音

转载 作者:数据小太阳 更新时间:2023-10-29 07:20:00 27 4
gpt4 key购买 nike

我正在使用 Ruby on Rails 3.1.1 和 pg gem。

在我的 Gemfile.lock 中,这是我拥有的

pg (0.11.0)

我的日志中充满了如下所示的信息。我没有用 sqlite3 得到那种噪音。我怎样才能抑制噪音。

PK and serial sequence (1.6ms)   SELECT attr.attname, seq.relname
FROM pg_class seq,
pg_attribute attr,
pg_depend dep,
pg_namespace name,
pg_constraint cons
WHERE seq.oid = dep.objid
AND seq.relkind = 'S'
AND attr.attrelid = dep.refobjid
AND attr.attnum = dep.refobjsubid
AND attr.attrelid = cons.conrelid
AND attr.attnum = cons.conkey[1]
AND cons.contype = 'p'
AND dep.refobjid = '"companies_users"'::regclass
PK and custom sequence (0.8ms) SELECT attr.attname,
CASE
WHEN split_part(def.adsrc, '''', 2) ~ '.' THEN
substr(split_part(def.adsrc, '''', 2),
strpos(split_part(def.adsrc, '''', 2), '.')+1)
ELSE split_part(def.adsrc, '''', 2)
END
FROM pg_class t
JOIN pg_attribute attr ON (t.oid = attrelid)
JOIN pg_attrdef def ON (adrelid = attrelid AND adnum = attnum)
JOIN pg_constraint cons ON (conrelid = adrelid AND adnum = conkey[1])
WHERE t.oid = '"companies_users"'::regclass
AND cons.contype = 'p'
AND def.adsrc ~* 'nextval'

最佳答案

我相信这个 gem 应该有所帮助 https://github.com/dolzenko/silent-postgres

用法非常简单:只需将“silent-postgres”添加到您的 Gemfile 即可。

关于ruby-on-rails - 如何去除 postgresql 噪音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8448381/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com