mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-01-26 00:55:58 -05:00
Merge pull request #1959 from matrix-org/erikj/intern_once
Intern table column names once
This commit is contained in:
commit
d638a7484b
@ -18,7 +18,6 @@ from synapse.api.errors import StoreError
|
|||||||
from synapse.util.logcontext import LoggingContext, PreserveLoggingContext
|
from synapse.util.logcontext import LoggingContext, PreserveLoggingContext
|
||||||
from synapse.util.caches.dictionary_cache import DictionaryCache
|
from synapse.util.caches.dictionary_cache import DictionaryCache
|
||||||
from synapse.util.caches.descriptors import Cache
|
from synapse.util.caches.descriptors import Cache
|
||||||
from synapse.util.caches import intern_dict
|
|
||||||
from synapse.storage.engines import PostgresEngine
|
from synapse.storage.engines import PostgresEngine
|
||||||
import synapse.metrics
|
import synapse.metrics
|
||||||
|
|
||||||
@ -356,9 +355,9 @@ class SQLBaseStore(object):
|
|||||||
Returns:
|
Returns:
|
||||||
A list of dicts where the key is the column header.
|
A list of dicts where the key is the column header.
|
||||||
"""
|
"""
|
||||||
col_headers = list(column[0] for column in cursor.description)
|
col_headers = list(intern(column[0]) for column in cursor.description)
|
||||||
results = list(
|
results = list(
|
||||||
intern_dict(dict(zip(col_headers, row))) for row in cursor.fetchall()
|
dict(zip(col_headers, row)) for row in cursor.fetchall()
|
||||||
)
|
)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user