用select * from xxx 和使用select 所要的字段,所用的逻辑读都一样吧,查询记录中的某些字段的代价和查询整条记录的代价都一样吧(读一整条记录的块数和读记录中某些字段的块数都相同吧)?
感觉怪怪的。。哈哈
不使用select * 可以:
1)不用去解析数据字典中的相应字段。
2)减少不必要的网络流量。
3)防止应用上引用,导致后续如果添加字段可能问题出现。
SQL> select * from test;
已选择50373行。
统计信息
----------------------------------------------------------
5 recursive calls
0 db block gets
4086 consistent gets
0 physical reads
0 redo size
2439715 bytes sent via SQL*Net to client
37323 bytes received via SQL*Net from client
3360 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
50373 rows processed
SQL> select status from test;
已选择50373行。
统计信息
----------------------------------------------------------
4 recursive calls
0 db block gets
4086 consistent gets
0 physical reads
0 redo size
679032 bytes sent via SQL*Net to client
37323 bytes received via SQL*Net from client
3360 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
50373 rows processed
SQL> select last_ddl_time,status from test;
已选择50373行。
统计信息
----------------------------------------------------------
4 recursive calls
0 db block gets
4086 consistent gets
0 physical reads
0 redo size
721999 bytes sent via SQL*Net to client
37323 bytes received via SQL*Net from client
3360 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
50373 rows processed