- 论坛徽章:
- 0
|
本帖最后由 zhn158 于 2012-08-17 13:50 编辑
tblcell 1万多个记录, tbl110共有700000条记录,使用select 计算各种指标,比如:- select start_date, lac_ci, 公式1, 公式2, 公式3, ......, 公式60 from tbl110 join tblcell using (LAC_CI) where region1='TD';
复制代码 其中tblcell中符合 region='TD',约有5千个记录,这条语句运行下来要1个多小时,无法忍受
求高手诊断
以下两个表格格式:
tblcell- +-----------+----------------------+------+-----+---------+-------+
- | Field | Type | Null | Key | Default | Extra |
- +-----------+----------------------+------+-----+---------+-------+
- | LAC_CI | varchar(11) | NO | PRI | | |
- | CellName | varchar(50) | YES | | NULL | |
- | LAC | smallint(5) unsigned | YES | | NULL | |
- | CI | smallint(5) unsigned | YES | | NULL | |
- | Longitude | float | YES | | NULL | |
- | Latitude | float | YES | | NULL | |
- | Dir | smallint(6) | YES | | NULL | |
- | Region | varchar(50) | YES | MUL | NULL | |
- | Region1 | varchar(50) | YES | MUL | NULL | |
- | Region2 | varchar(50) | YES | MUL | NULL | |
- | CellType | varchar(10) | YES | | NULL | |
- | nbrTRX | tinyint(3) unsigned | YES | | NULL | |
- | Band | varchar(5) | YES | | NULL | |
- | BSC | varchar(15) | YES | | NULL | |
- | OMC | varchar(10) | YES | | NULL | |
- | BCCH | smallint(6) | YES | | NULL | |
- +-----------+----------------------+------+-----+---------+-------+
复制代码 tbl110
[/code]tbl110- +------------+----------------------+------+-----+---------------------+-------+
- | Field | Type | Null | Key | Default | Extra |
- +------------+----------------------+------+-----+---------------------+-------+
- | Start_Date | datetime | NO | PRI | 0000-00-00 00:00:00 | |
- | LAC_CI | varchar(11) | NO | PRI | | |
- | CELL_CI | smallint(5) unsigned | YES | MUL | NULL | |
- | CELL_LAC | smallint(5) unsigned | YES | MUL | NULL | |
- | MC01 | int(11) | YES | | NULL | |
- | MC02 | int(11) | YES | | NULL | |
- | MC02A | int(11) | YES | | NULL | |
- ....................................................................(省略了200多个字段)............................................................
- +------------+----------------------+------+-----+---------------------+-------+
复制代码 |
|