怎么确定表的extent是否达到最大限制或者说表的extents数量过多
看了一篇优化的文章,说如果表的extents数量过多,需要对表进行重建工作,原文表述如下:
3.4 表扩展块情况
--FileName: extents.sql
--获取系统中extents最多的表的表名,所在的数据库名,extents的数量
--sysextents表9.2版本和9.4版本的结构有不同,但不影响本sql执行
UNLOAD TO extents.txt DELIMITER " "
SELECT FIRST 20 t.dbsname, t.tabname, count(*)
FROM sysmaster:systabnames t, sysmaster:sysextents e
WHERE t.dbsname = e.dbsname
AND t.tabname = e.tabname
AND t.tabname[1,3] != "sys"
GROUP BY 1,2
ORDER BY 3 DESC
如果发现表的extents数量过多,就要考虑调整extents的大小,并且重建表。
我在我的数据库上执行了一下,得到如下结果:
crm historycallinfo 218.0
crm historycallinfo 218.0
crm updateuserinfo 180.0
crm icallinfo_or 176.0
crm contact 163.0
crm puserinfo 163.0
crm his_custumurl 161.0
crm 144_447 160.0
crm icallinfo_em 139.0
crm icallinfo_de 137.0
crm dayinfo 131.0
crm icontactus_ 129.0
crm ipuserinfo_us 128.0
crm icontactcom_ 128.0
crm iupdateuserinfous_ 127.0
crm ipuserinfo_companyname 125.0
crm workplan 123.0
crm personal 118.0
crm sellersum 115.0
crm historycallinfo_call 114.0
不知道这样算不算多的?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
extents个数当然是少点比较好,不过一般来说在50个以下性能都是可以接受的,到200个基本就不能用了
extend达到极限时,重建表,这往往是表当初的规划有关系。
那就改吧~~~~建立重建这个表~~
我按你的方法把结果导出来了,上面这样是不是有10个extents?
那是非常多的了
Extents
Logical Page Physical Page Size
0 5227a1 108
108 52442d 4
112 526d93 4
116 529209 4
120 52a8d5 4
124 52c919 4
128 52ee35 4
132 53573f 4
136 53b74f 4
140 53c9e3 4
144 53dae7 4
148 53edd5 4
152 54030d 4
156 541639 4
160 542bad 4
164 544761 4
168 5455c1 8
176 54973d 8
184 54c5d9 8
192 54f6c9 8
200 555167 8
208 557def 8
216 55c4c3 8
224 55fe47 8
Index redeploy_deptmanager fragment in DBspace datadbs
Physical Address 521308
Creation date 04/05/2007 14:17:10
TBLspace Flags 802 Row Locking
TBLspace use 4 bit bit-maps
Maximum row size 574
Number of special columns 0
Number of keys 1
Number of extents 17
Current serial value 1
First extent size 4
Next extent size 8
Number of pages allocated 132
Number of pages used 129
Number of data pages 0
Number of rows 0
Partition partnum 5243239
Partition lockid 5243233
Extents
Logical Page Physical Page Size
0 522939 64
64 527eed 4
68 529c71 4
72 52a48d 4
76 52afd9 4
80 52ece9 4
84 53d017 4
88 53d7a3 4
92 540d69 4
96 545335 4
100 5472a1 4
104 549d19 4
108 54e2bd 4
112 5518f1 4
116 55576b 4
120 54da45 4
124 55fe57 8
Index redeploy_deptno fragment in DBspace datadbs
Physical Address 521305
Creation date 04/05/2007 14:17:10
TBLspace Flags 802 Row Locking
TBLspace use 4 bit bit-maps
Maximum row size 574
Number of special columns 0
Number of keys 1
Number of extents 19
Current serial value 1
First extent size 4
Next extent size 8
Number of pages allocated 164
Number of pages used 159
Number of data pages 0
Number of rows 0
Partition partnum 5243236
Partition lockid 5243233
Extents
Logical Page Physical Page Size
0 522875 80
80 526bbb 4
84 5291f5 4
88 52a801 4
92 52b2f5 4
96 52c9c9 4
100 534bef 4
104 535a1b 4
108 53d0bf 4
112 53ecb5 4
116 54056d 4
120 542771 4
124 54757d 4
128 549549 4
132 54de9d 4
136 550739 4
140 5557d7 8
148 55a74f 8
156 5606af 8
Index redeploy_employeeid fragment in DBspace datadbs
Physical Address 521304
Creation date 04/05/2007 14:17:09
TBLspace Flags 802 Row Locking
TBLspace use 4 bit bit-maps
Maximum row size 574
Number of special columns 0
Number of keys 1
Number of extents 22
Current serial value 1
First extent size 4
Next extent size 8
Number of pages allocated 212
Number of pages used 208
Number of data pages 0
Number of rows 0
Partition partnum 5243235
Partition lockid 5243233
Extents
Logical Page Physical Page Size
0 52280d 104
104 525c9f 4
108 5291a5 4
112 529ab5 4
116 52a885 4
120 52caa1 4
124 533da7 4
128 535def 4
132 53c9eb 4
136 53dbff 4
140 53f679 4
144 540c99 4
148 5427e9 4
152 54527d 4
156 5487e9 4
160 54a2bd 4
164 54b4b9 8
172 54dcf1 8
180 554dc3 8
188 55797b 8
196 55db4f 8
204 56120b 8
Index redeploy_groupmanager fragment in DBspace datadbs
Physical Address 521307
Creation date 04/05/2007 14:17:10
TBLspace Flags 802 Row Locking
TBLspace use 4 bit bit-maps
Maximum row size 574
Number of special columns 0
Number of keys 1
Number of extents 17
Current serial value 1
First extent size 4
Next extent size 8
Number of pages allocated 120
Number of pages used 114
Number of data pages 0
Number of rows 0
Partition partnum 5243238
Partition lockid 5243233
Extents
Logical Page Physical Page Size
0 522905 52
52 52429d 4
56 5262d3 4
60 5346df 4
64 53b74b 4
68 53c9e7 4
72 53e4bd 4
76 540d6d 4
80 543f85 4
84 5487ed 4
88 54b1a5 4
92 54ec19 4
96 552b9d 4
100 557d37 4
104 55a31b 4
108 550735 4
112 56143f 8
Index redeploy_rdeptmanager fragment in DBspace datadbs
Physical Address 52130a
Creation date 04/05/2007 14:17:11
TBLspace Flags 802 Row Locking
TBLspace use 4 bit bit-maps
Maximum row size 574
Number of special columns 0
Number of keys 1
Number of extents 17
Current serial value 1
First extent size 4
Next extent size 8
Number of pages allocated 124
Number of pages used 122
Number of data pages 0
Number of rows 0
Partition partnum 5243241
Partition lockid 5243233
Extents
Logical Page Physical Page Size
0 5229b1 56
56 526887 4
60 5274e7 4
64 528649 4
68 529e99 4
72 533acb 4
76 53d1c3 4
80 53f72d 4
84 541a25 4
88 544441 4
92 54956d 4
96 54c9ad 4
100 551141 4
104 554b33 4
108 5567ef 4
112 557d53 4
116 55c20b 8
Index redeploy_rdeptno fragment in DBspace datadbs
Physical Address 521306
Creation date 04/05/2007 14:17:10
TBLspace Flags 802 Row Locking
TBLspace use 4 bit bit-maps
Maximum row size 574
Number of special columns 0
Number of keys 1
Number of extents 19
Current serial value 1
First extent size 4
Next extent size 8
Number of pages allocated 148
Number of pages used 145
Number of data pages 0
Number of rows 0
Partition partnum 5243237
Partition lockid 5243233
Extents
Logical Page Physical Page Size
0 5228c5 64
64 524431 4
68 525b3b 4
72 52729b 4
76 528379 4
80 52924d 4
84 52ee89 4
88 53ca73 4
92 53e535 4
96 543375 4
100 5457a9 4
104 54758d 4
108 549f2d 4
112 54b2a5 4
116 54d4dd 4
120 54eb8d 4
124 551961 8
132 558eeb 8
140 55e213 8
Index redeploy_redeploydate fragment in DBspace datadbs
Physical Address 52130b
Creation date 04/05/2007 14:17:11
TBLspace Flags 802 Row Locking
TBLspace use 4 bit bit-maps
Maximum row size 574
Number of special columns 0
Number of keys 1
Number of extents 20
Current serial value 1
First extent size 4
Next extent size 8
Number of pages allocated 184
Number of pages used 179
Number of data pages 0
Number of rows 0
Partition partnum 5243242
Partition lockid 5243233
Extents
Logical Page Physical Page Size
0 5229e9 92
92 5260ab 4
96 529689 4
100 52ba15 4
104 52d10d 4
108 535133 4
112 53676f 4
116 53de79 4
120 53fd39 4
124 541a3d 4
128 5443ad 4
132 54726d 4
136 549d6d 4
140 54bb8d 4
144 54d911 4
148 54f6d1 4
152 552b65 8
160 557dfb 8
168 55d757 8
176 562053 8
Index redeploy_rgroupmanager fragment in DBspace datadbs
Physical Address 521309
Creation date 04/05/2007 14:17:10
TBLspace Flags 802 Row Locking
TBLspace use 4 bit bit-maps
Maximum row size 574
Number of special columns 0
Number of keys 1
Number of extents 17
Current serial value 1
First extent size 4
Next extent size 8
Number of pages allocated 124
Number of pages used 121
Number of data pages 0
Number of rows 0
Partition partnum 5243240
Partition lockid 5243233
Extents
Logical Page Physical Page Size
0 522979 56
56 52531f 4
60 52be6d 4
64 53499f 4
68 53661f 4
72 53d24b 4
76 53e4e1 4
80 540575 4
84 5465e5 4
88 549d69 4
92 54b269 4
96 54f0b5 4
100 556c7b 4
104 557df7 4
108 55beb3 4
112 55e127 4
116 55f9c3 8
TBLspace Report for zzymis:informix.redeploy
Physical Address 521302
Creation date 04/05/2007 14:17:09
TBLspace Flags 902 Row Locking
TBLspace contains VARCHARS
TBLspace use 4 bit bit-maps
Maximum row size 574
Number of special columns 1
Number of keys 0
Number of extents 83
Current serial value 35117
First extent size 8
Next extent size 256
Number of pages allocated 8352
Number of pages used 8347
Number of data pages 8344
Number of rows 33372
Partition partnum 5243233
Partition lockid 5243233
Extents
Logical Page Physical Page Size
0 521979 3624
3624 51747b 8
3632 50d525 8
3640 519bbb 8
3648 523b85 8
3656 523e41 8
3664 523f4d 8
3672 52415d 8
3680 524171 8
3688 524285 8
3696 524435 8
3704 524549 8
3712 52527f 8
3720 525323 8
3728 5253ab 8
3736 5255ff 8
3744 5257b7 16
3760 525a3b 16
3776 52603b 16
3792 52657b 16
3808 52666b 16
3824 52699f 16
3840 526d53 16
3856 526e6f 16
3872 527033 16
3888 5272c7 16
3904 5274eb 16
3920 527941 16
3936 5285a5 16
3952 528d75 16
3968 528e29 16
3984 529185 16
4000 5295dd 32
4032 52999d 32
4064 529da5 32
4096 52a01d 32
4128 52a795 32
4160 52ab29 32
4192 52adcd 32
4224 52afb9 32
4256 52b9e5 32
4288 52bed5 32
4320 52c981 32
4352 52cbb1 32
4384 52d149 32
4416 52d6b1 32
4448 52ec75 32
4480 533b0b 32
4512 534393 64
4576 534e4f 64
4640 535883 64
4704 535c37 64
4768 53b753 64
4832 53bec3 64
4896 53c7d7 64
4960 53cf4f 64
5024 53d4a7 64
5088 53dc67 64
5152 53e3b9 64
5216 53ed59 64
5280 53f841 64
5344 53fdd5 64
5408 540525 64
5472 540e71 64
5536 54163d 128
5664 5429e9 128
5792 544111 128
5920 545609 128
6048 547d6d 128
6176 548e4d 128
6304 54a15d 128
6432 54b3b9 128
6560 54c8ed 128
6688 54dd41 128
6816 54f0b9 128
6944 551259 128
7072 553fbf 128
7200 55676b 128
7328 5571df 128
7456 557f63 128
7584 559d0f 256
7840 55d58f 256
8096 560327 256
Index 219_1359 fragment in DBspace datadbs
Physical Address 521303
Creation date 04/05/2007 14:17:09
TBLspace Flags 802 Row Locking
TBLspace use 4 bit bit-maps
Maximum row size 574
Number of special columns 0
Number of keys 1
Number of extents 24
Current serial value 1
First extent size 4
Next extent size 8
Number of pages allocated 232
Number of pages used 232
Number of data pages 0
Number of rows 0
Partition partnum 5243234
Partition lockid 5243233
[ 本帖最后由 haoyunkkg 于 2008-8-18 15:43 编辑 ]
informix期望每个表都在较小的数目的extent上..一般认为多于5个就是多了,多于10个就是很多了....
BTW:这个从数据库sysmaster库中取的数据不一定准确,请使用oncheck -pt <dbname>:<tabname>来检查是否是真有的那样多个extent..