我有一个 Access 2003 DB,我想提高它的性能。昨天,我读了一篇关于执行计划(Show Plan)的文章,今天我为这个查询运行了我的 show Plan:
SELECT tb_bauteile_Basis.*
FROM tb_bauteile_Basis
ORDER BY tb_bauteile_Basis.Name;
我在该字段上放置了一个索引Name
,并显示了它的查询计划:
Inputs to Query -
Table 'tb_bauteile_Basis'
Using index 'Name'
Having Indexes:
Name 1553 entries, 17 pages, 1543 values
which has 1 column, fixed
ID 1553 entries, 4 pages, 1553 values
which has 1 column, fixed, clustered and/or counter
- End inputs to Query -
01) Scan table 'tb_bauteile_Basis'
Using index 'Name'
接下来,我从 中删除了索引Name
,新的查询计划为:
- Inputs to Query -
Table 'tb_bauteile_Basis'
Using index 'PrimaryKey'
Having Indexes:
PrimaryKey 1553 entries, 4 pages, 1553 values
which has 1 column, fixed, unique, clustered and/or counter, primary-key, no-nulls
Plauskomponente 1553 entries, 4 pages, 3 values
which has 1 column, fixed
Name 1553 entries, 17 pages, 1543 values
which has 1 column, fixed
ID 1553 entries, 4 pages, 1553 values
which has 1 column, fixed, clustered and/or counter
- End inputs to Query -
01) Scan table 'tb_bauteile_Basis'
Using index 'PrimaryKey'
我应该如何解释这两个查询计划?
在第二个 Showplan 中,我应该为 建立一个索引Plauskomponente,Name,ID
,我应该为这三个字段建立一个复合索引吗?如何确定是否应该制作综合索引?
为什么没有Plauskommponente
出现在第一个展示计划中?