feat: add size async caching (#2532)
This commit is contained in:
@@ -90,4 +90,8 @@ class AgentPassage(BasePassage, AgentMixin):
|
||||
Index("agent_passages_created_at_id_idx", "created_at", "id"),
|
||||
{"extend_existing": True},
|
||||
)
|
||||
return (Index("agent_passages_created_at_id_idx", "created_at", "id"), {"extend_existing": True})
|
||||
return (
|
||||
Index("ix_agent_passages_org_agent", "organization_id", "agent_id"),
|
||||
Index("agent_passages_created_at_id_idx", "created_at", "id"),
|
||||
{"extend_existing": True},
|
||||
)
|
||||
|
||||
@@ -840,7 +840,7 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
||||
**kwargs,
|
||||
):
|
||||
logger.debug(f"Calculating size for {cls.__name__} with filters {kwargs}")
|
||||
query = select(func.count()).select_from(cls)
|
||||
query = select(func.count(1)).select_from(cls)
|
||||
|
||||
if actor:
|
||||
query = cls.apply_access_predicate(query, actor, access, access_type)
|
||||
|
||||
Reference in New Issue
Block a user