当我将未具体化的计算列添加到表中时,ASE 决定复制整个表,而数据页的实际内容不受影响。
例子:
create table t (i int null)
go
set showplan on
go
alter table t
add c compute (i+1) not materialized
go
QUERY PLAN FOR STATEMENT 1 (at line 1).
...
| |INSERT Operator (VA = 1)
...
| | |SCAN Operator (VA = 0)
| | | FROM TABLE
| | | t
| | | Table Scan.
...
| | TO TABLE
| | #syb__altab
...
如果您检查页面内容,dbcc page
您可能会发现新旧页面是相同的
- 为什么 ASE 会做这个无用的操作?
- 有可能避免吗?