Profile

motcha

28654 posts 295 follows 404 followers

こんなんですが.motcha.techの管理人
インターネット老人会所属

https://mastodon.motcha.tech/@mot
motcha motcha reblogged at 7 years ago

tateisu​:r_9a:​:force: tateisu@mastodon.juggler.jp

postgresqlのlog_statementをいじって確認したんですけど、Railsってクエリ中の定数パラメータ(where visiblity=3 みたいなの) を prepared statement のためにbind parameter 化するんですよ。そしてPostgreSQLはbind parameterに関しては部分インデクスの利用を行ってくれないのです。.env.production に PREPARED_STATEMENTS=false って書いとけばこの現象は起きません。pgbouncer導入してる人は既にこうなってるはず。