perf: no caching for prefer timezone - #5128
Conversation
ad07b57 to
8351d26
Compare
8351d26 to
e2dcfab
Compare
|
This is not a fix, but a performance improvement. |
|
Oh, I think you missed removing the changelog entry from the unreleased section: Line 14 in e820cc7 |
Ah but the incorrect reloading part we discussed on #4751 (comment) seems like a bug to me. If someone did modify their timezones the cache would not be reloaded. For #5100 it would be purely |
"automatic reloading" is not a feature that PostgREST provides. It's part of the documentation for how to set it up. The bug is not in PostgREST - it's just that this recommendation does not cover this aspect. You could argue that this recommendation is wrong - but we never call wrong things in the docs "bugs" or changes to the docs "fix". One approach to resolve this issue would be to correct the docs as I mentioned earlier. You instead opted to change the code as part of a performance improvement, which makes the issue obsolete. Still not a bug, nor a fix. Especially the PR title / commit message is just wrong: The caching of timezones was always correct, there was not a problem with it. |
8f4a8df to
8c79c57
Compare
|
Changed the commit prefix to |
6907417 to
f6c539c
Compare
|
Just did a and this: Lines 240 to 251 in 6304265 |
2bc7c2b to
70247cc
Compare
wolfgangwalther
left a comment
There was a problem hiding this comment.
Needs a rebase to resolve conflicts, too.
6ee378b to
d96dadd
Compare
|
Addressed all the feedback. |
…zones" This reverts commit d6c338d.
`Prefer: timezone` no longer requires the schema cache. Previously this required caching `pg_timezone_names` which was slow in some systems. Closes PostgREST#5100 and PostgREST#4751.
d96dadd to
361adc0
Compare
|
Thank you! ❤️ |
Fixes #5100 and #4751.
This essentially removes the timezones from the schema cache. Please read the latest comments on #5100 to fully understand the implementation.
To discuss
Edit: We'll keep the revert as we're not going to have a lenient variant as discussed below.
Here I've also removed the
db-timezone-enabledconfig by reverting d6c338d. But we might want to keep it given that the query in thehandling=lenientcase is kinda expensive (ref). Some users might not want clients forcing that query.Or perhaps we can have a config similar to the one for
Prefer:tx, only allowing the strict timezone handling.