feat: 工参表按 CGI 和基站 ID 加索引

CellData_4G 唯一索引改为 (cgi, snapshot_id),另加 (enodeb_id, snapshot_id);CellData_5G 对应 (ncgi, snapshot_id)、(gnodeb_id, snapshot_id),跨日期按小区或基站查询都能走索引。
This commit is contained in:
2026-11-11 03:06:31 +08:00
parent 688441f4a7
commit 14d1b4c7bc
3 changed files with 41 additions and 5 deletions
+4 -2
View File
@@ -106,7 +106,8 @@ class CellData4G(Base):
__tablename__ = "CellData_4G"
__table_args__ = (
UniqueConstraint("snapshot_id", "cgi", name="uq_celldata_4g_cgi"),
UniqueConstraint("cgi", "snapshot_id", name="uq_celldata_4g_cgi"),
Index("ix_celldata_4g_enodeb", "enodeb_id", "snapshot_id"),
Index("ix_celldata_4g_station", "snapshot_id", "station_name"),
)
@@ -134,7 +135,8 @@ class CellData5G(Base):
__tablename__ = "CellData_5G"
__table_args__ = (
UniqueConstraint("snapshot_id", "ncgi", name="uq_celldata_5g_ncgi"),
UniqueConstraint("ncgi", "snapshot_id", name="uq_celldata_5g_ncgi"),
Index("ix_celldata_5g_gnodeb", "gnodeb_id", "snapshot_id"),
Index("ix_celldata_5g_station", "snapshot_id", "station_name"),
)