perf: no caching for prefer timezone
`Prefer: timezone` no longer requires the schema cache. Previously this required caching `pg_timezone_names` which was slow in some systems. Closes https://github.com/PostgREST/postgrest/issues/5100 and https://github.com/PostgREST/postgrest/issues/4751.
This commit is contained in:
committed by
Steve Chavez
parent
a41396c425
commit
932c4f6328
File diff suppressed because it is too large
Load Diff
+1
-2
@@ -237,7 +237,6 @@ def test_invalid_openapi_mode(invalidopenapimodes, defaultenv):
|
||||
"dbRepresentations",
|
||||
"dbRoutines",
|
||||
"dbTables",
|
||||
"dbTimezones",
|
||||
],
|
||||
)
|
||||
def test_schema_cache_snapshot(baseenv, key, snapshot_yaml):
|
||||
@@ -248,7 +247,7 @@ def test_schema_cache_snapshot(baseenv, key, snapshot_yaml):
|
||||
schema_cache[key],
|
||||
encoding="utf8",
|
||||
allow_unicode=True,
|
||||
Dumper=yaml.SafeDumper if key == "dbTimezones" else ExtraNewLinesDumper,
|
||||
Dumper=ExtraNewLinesDumper,
|
||||
)
|
||||
assert formatted == snapshot_yaml
|
||||
|
||||
|
||||
+1
-3
@@ -1002,9 +1002,8 @@ def test_schema_cache_query_timings_log(level, defaultenv):
|
||||
**defaultenv,
|
||||
"PGRST_LOG_LEVEL": level,
|
||||
}
|
||||
# here we also capture the tzones: <value> ms
|
||||
log_pattern = re.compile(
|
||||
r".+: tables: [\d.]+ ms, keydeps: [\d.]+ ms, rels: [\d.]+ ms, funcs: [\d.]+ ms, comprels: [\d.]+ ms, dreps: [\d.]+ ms, mhandlers: [\d.]+ ms, tzones: ([\d.]+) ms"
|
||||
r".+: tables: [\d.]+ ms, keydeps: [\d.]+ ms, rels: [\d.]+ ms, funcs: [\d.]+ ms, comprels: [\d.]+ ms, dreps: [\d.]+ ms, mhandlers: [\d.]+ ms"
|
||||
)
|
||||
|
||||
with run(env=env, no_startup_stdout=False) as postgrest:
|
||||
@@ -1015,7 +1014,6 @@ def test_schema_cache_query_timings_log(level, defaultenv):
|
||||
|
||||
if level == "debug":
|
||||
assert len(timing_matches) == 1
|
||||
assert float(timing_matches[0].group(1)) > 0
|
||||
else:
|
||||
assert not timing_matches
|
||||
|
||||
|
||||
Reference in New Issue
Block a user