Notes on ‘Expert Oracle’ — No.10.3: Table — 聚簇表

1.引子 问题:我经常连接表A和表B,除了建立表索引外吗,还有别的优化手段吗? 答案:有。如果A和B相应的一组数据在同一个块中,那么查询时就不需要取出那么多块了,I/O效率会高很多。 2.什么是聚簇   a. A和B的同组数据放在同一个块中,如果A和B经常连结   b. 同一张表中共享同一列值的行尽量放在同一个块中 3.一个聚簇块应该放几行数据?   要恰当地设置这个值。     a.如果行数太少,则会浪费块的空间     b.如果行数太多,则可能会导致 块 不能容纳整行数据,而只能通过串链解决问题。串链太多就适得其反了。 4.什么时候应该用聚簇    以读为主、且主要使用索引读、并且经常要进行连接查询的一组表应该放在同一个聚族中。

Notes on ‘Expert Oracle’ — No.10.1: Table — Segment Space Management

1. Tow modes of Segment Space Management    a. Automatic — ASSM    b. Manual    — MSSM We only care about ASSM here. 2.High-water Mark 2.1 What is it for ? Question:  I’ve deleted all the data from the table by using "delete from …". Why does "select count(*) from …" take a long time? …

Notes on ‘Expert Oracle’ — No.10.1: Table — Segment Space Management Read More »

Notes on ‘Expert Oracle’ — No.9.6: Redo&Undo — Undo Log

1. Amount of Undo Log     Delete > Update > Insert     Operations on Indexed Columns > Operations on Non-indexed 2. What can cause "Snap Too Old"  exception?  => The undo segment is too small 3. How to make the undo segment not so small?    a. Enlarge it, of course       i.Enlarge UNDO_RETENTION, which …

Notes on ‘Expert Oracle’ — No.9.6: Redo&Undo — Undo Log Read More »

Notes on ‘Expert Oracle’ — No.9.5: Redo&Undo — Block Cleanout

a.When data blocks are involved in a transaction, there are locking info created in the block. b.This info should be cleaned out when the transaction ends. c.They can be cleaned out immediately when the transaction ends, but not definitely.    —- There are cleaned out on commitment, only if the blocks needed to be cleaned …

Notes on ‘Expert Oracle’ — No.9.5: Redo&Undo — Block Cleanout Read More »

Notes on ‘Expert Oracle’ — No.9.4: Redo&Undo — More about Redo Log

1. The large your Redo log is, the more time-consuming your SQL operation is. 2. Can we turn off Redo Log?    a. Not Recommeded    b. You can use "NOLOGGING" in SQLs to reduce much of the log.    c. You can also use "NOLOGGING" for INDEX. This is actually acceptable. 3. How to …

Notes on ‘Expert Oracle’ — No.9.4: Redo&Undo — More about Redo Log Read More »