Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pac
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tools
pac
Commits
51438523
Commit
51438523
authored
Oct 09, 2026
by
luoqi
Browse files
Options
Browse Files
Download
Plain Diff
Merge PAC fact query statistics fix into test
parents
c761952e
f6af85da
Pipeline
#3721
failed in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
apps/pac-service/prisma/migrations/20261008170000_fact_host_tenant_statistics/migration.sql
+8
-0
No files found.
apps/pac-service/prisma/migrations/20261008170000_fact_host_tenant_statistics/migration.sql
0 → 100644
View file @
51438523
-- 宿主和租户高度相关;独立选择率相乘会严重低估小宿主的事实量。
-- 测试库 2093 万行中,Friday 的两列选择率各约 1.78%。未声明依赖时,
-- 单患者详情误走 patient_id 与 host/tenant/status 的 BitmapAnd,实测约 48 秒。
-- 联合统计让优化器正确估算宿主范围,选择患者索引;保留所有租户隔离条件。
-- ⛔ 不通过禁用 bitmapscan 或移除 host/tenant 条件绕过问题。
CREATE
STATISTICS
IF
NOT
EXISTS
patient_facts_host_tenant_dependencies
(
dependencies
)
ON
host_id
,
tenant_id
FROM
patient_facts
;
ANALYZE
patient_facts
(
host_id
,
tenant_id
,
patient_id
,
status
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment