You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever the db is complex, loading the schema cache takes a while (this is #3046). One consequence of that is that requests that use the schema cache are slow:
$ curl 'localhost:3000/tpopmassn?select=*,tpop(*)' -i
Server-Timing: jwt;dur=0.0, parse;dur=0.1, plan;dur=11371.5, transaction;dur=0.6, response;dur=0.0
[]
# see the "plan;dur=11371.5", it's ~11 seconds
(Note that requests that don't use the schema cache, such as curl 'localhost:3000/tpop, aren't affected by this, they're fast)
That is expected of #3046. However, the same problem happens when reloading the schema cache.
postgres=# notify pgrst;
14/Mar/2024:11:26:10 -0500: Attempting to connect to the database...
14/Mar/2024:11:26:10 -0500: Successfully connected to PostgreSQL 16.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 12.3.0, 64-bit
14/Mar/2024:11:26:10 -0500: Config reloaded
14/Mar/2024:11:26:10 -0500: Schema cache queried in 45.8 milliseconds
The text was updated successfully, but these errors were encountered:
steve-chavez
added
QOS
enhancement
a feature, ready for implementation
idea
Needs of discussion to become an enhancement, not ready for implementation
and removed
enhancement
a feature, ready for implementation
idea
Needs of discussion to become an enhancement, not ready for implementation
labels
Mar 14, 2024
In some cases it'd be better to wait instead of err.
This is definitely always the desired behavior I think. It's better to be correct/slower and not let clients run into some non-existent column error. I'll revert back this change.
This is definitely always the desired behavior I think. It's better to be correct/slower and not let clients run into some non-existent column error. I'll revert back this change.
Problem
Whenever the db is complex, loading the schema cache takes a while (this is #3046). One consequence of that is that requests that use the schema cache are slow:
(Note that requests that don't use the schema cache, such as
curl 'localhost:3000/tpop
, aren't affected by this, they're fast)That is expected of #3046. However, the same problem happens when reloading the schema cache.
Solution
Use the stale schema cache while waiting for the new one to be loaded.
Edit: The fix is soo simple. And the test is sooo much work.
Related
The text was updated successfully, but these errors were encountered: