williamdclt
03/24/2023, 4:11 PMplan_cache_mode
to force_custom_plan
fixed it.
Can we do the same fix as last time in SpiceDB? Disabling plan caching when calling out to pgx IIRCJoey
03/24/2023, 4:25 PMwilliamdclt
03/24/2023, 10:03 PMsql
SELECT namespace, object_id, relation, userset_namespace, userset_object_id, userset_relation, caveat_name, caveat_context FROM relation_tuple WHERE pg_visible_in_snapshot(created_xid, $1) = $2 AND pg_visible_in_snapshot(deleted_xid, $3) = $4 AND namespace = $5 AND relation = $6 AND object_id IN ($7) AND ((userset_namespace = $8 AND userset_object_id IN ($9) AND userset_relation = $10)) LIMIT 9223372036854775807
Joey
03/24/2023, 10:04 PMwilliamdclt
04/11/2023, 9:47 AMJoey
04/11/2023, 2:55 PMwilliamdclt
04/11/2023, 3:38 PMpgx
is overreaching with this prepared statement behaviour by defaultJoey
04/11/2023, 3:44 PMwilliamdclt
04/11/2023, 3:46 PMplan_cache_mode=force_custom_plan
postgres paramJoey
04/11/2023, 3:46 PMwilliamdclt
04/14/2023, 2:17 PMJoey
04/14/2023, 2:21 PMwilliamdclt
04/14/2023, 2:34 PMJoey
04/14/2023, 2:38 PMwilliamdclt
04/14/2023, 2:38 PMJoey
04/14/2023, 2:40 PMwilliamdclt
04/14/2023, 2:42 PMJoey
04/14/2023, 2:43 PMwilliamdclt
04/14/2023, 2:45 PMJoey
04/14/2023, 2:46 PMwilliamdclt
04/14/2023, 2:49 PMJoey
04/14/2023, 2:51 PM// PreferSimpleProtocol disables implicit prepared statement usage. By default
// pgx automatically uses the unnamed prepared statement for Query and
// QueryRow. It also uses a prepared statement when Exec has arguments. This
// can improve performance due to being able to use the binary format. It also
// does not rely on client side parameter sanitization. However, it does incur
// two round-trips per query and may be incompatible proxies such as
// PGBouncer. Setting PreferSimpleProtocol causes the simple protocol to be
// used by default. The same functionality can be controlled on a per query
// basis by setting QueryExOptions.SimpleProtocol.
williamdclt
04/14/2023, 2:53 PMBuildStatementCache
to nil
might be what we want? https://pkg.go.dev/github.com/jackc/pgx/v4#ConnConfigJoey
04/14/2023, 2:55 PMwilliamdclt
04/14/2023, 3:50 PMSet to nil to disable automatic prepared statements
in the doc of BuildStatementCache
Joey
04/14/2023, 4:22 PM