mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-20 19:10:45 +03:00
Fix generality of query
This commit is contained in:
parent
1e0bd9a9c0
commit
fd184f6cd0
1 changed files with 4 additions and 4 deletions
|
@ -42,9 +42,9 @@ def _run_create_generic(stats_type, cursor, database_engine):
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"""
|
"""
|
||||||
CREATE INDEX IF NOT EXISTS %s_stats_not_complete
|
CREATE INDEX IF NOT EXISTS %s_stats_not_complete
|
||||||
ON %s_stats_current (completed_delta_stream_id, room_id);
|
ON %s_stats_current (completed_delta_stream_id, %s_id);
|
||||||
"""
|
"""
|
||||||
% (stats_type, stats_type)
|
% (stats_type, stats_type, stats_type)
|
||||||
)
|
)
|
||||||
elif isinstance(database_engine, PostgresEngine):
|
elif isinstance(database_engine, PostgresEngine):
|
||||||
# This partial index helps us with finding dirty stats rows
|
# This partial index helps us with finding dirty stats rows
|
||||||
|
@ -60,10 +60,10 @@ def _run_create_generic(stats_type, cursor, database_engine):
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"""
|
"""
|
||||||
CREATE INDEX IF NOT EXISTS %s_stats_not_complete
|
CREATE INDEX IF NOT EXISTS %s_stats_not_complete
|
||||||
ON %s_stats_current (room_id)
|
ON %s_stats_current (%s_id)
|
||||||
WHERE completed_delta_stream_id IS NULL;
|
WHERE completed_delta_stream_id IS NULL;
|
||||||
"""
|
"""
|
||||||
% (stats_type, stats_type)
|
% (stats_type, stats_type, stats_type)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError("Unknown database engine.")
|
raise NotImplementedError("Unknown database engine.")
|
||||||
|
|
Loading…
Reference in a new issue