mirror of
https://github.com/carrotquest/django-clickhouse.git
synced 2024-11-15 05:46:41 +03:00
Trying to speed up getting objects from multiple databases
This commit is contained in:
parent
241618d8ca
commit
1a4ed0ddf6
|
@ -161,7 +161,7 @@ class ClickHouseModel(with_metaclass(ClickHouseModelMeta, InfiModel)):
|
|||
|
||||
# Selecting data from multiple databases should work faster in parallel, if connections are independent.
|
||||
objs = exec_multi_arg_func(
|
||||
lambda db_alias: cls.get_sync_query_set(db_alias, pk_by_db[db_alias]),
|
||||
lambda db_alias: list(cls.get_sync_query_set(db_alias, pk_by_db[db_alias])),
|
||||
pk_by_db.keys()
|
||||
)
|
||||
return list(chain(*objs))
|
||||
|
|
Loading…
Reference in New Issue
Block a user