+ All Categories
Home > Documents > Partition Architecture Yeon JongHeum 2008. 07. 18.

Partition Architecture Yeon JongHeum 2008. 07. 18.

Date post: 18-Jan-2016
Category:
Upload: abigail-lynne-walker
View: 218 times
Download: 0 times
Share this document with a friend
Popular Tags:
19
Partition Architecture Yeon JongHeum 2008. 07. 18.
Transcript
Page 1: Partition Architecture Yeon JongHeum 2008. 07. 18.

Partition Architecture

Yeon JongHeum

2008. 07. 18.

Page 2: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Partition Table

Purpose

Efficient management of huge amount table

Guarantee performance

Concept

Separate a table to into several small table with condition

Examples of usage

History Table Management

Disk IO distribution

2

Page 3: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Single Table vs. Partition Table

Difficulty in management of large amount history table

Spend extra time in Rollback Segment and Redo Log

Inefficiency of Index

Example

– DELETE FROM history WHERE date LIKE ‘200310%’

vs.

– ALTER TABLE history drop partition 200310

3

Page 4: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Single Table vs. Partition Table

Slow down the performance of 1 row access

Size table grows => Brand block level grows in B-TREE In-dex => Depth increase

Slow in monthly report

Index Scan => 1/6 Random Access

Table Full Scan

4

vs.

Page 5: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Partition Table Type

Range Partition

Hash Partition

List Partition

Composite Partition

5

Page 6: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Range Partition

Components

Partition Key Column

Range Condition

Table Partition Segment

Partition Table

6

History Table

200404 Partition

200402 Partition

200403 Partition

Partition Table

Table Partition Segment

Partition Key Column(Date)

Value Less Than‘20040232’

Value Less Than‘20040332’

Value Less Than‘20040332’

Range Condition

Maxvalue

Page 7: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Range Partition

Point of consideration

Parallel processing

Disk IO distribution

Select range partition key column

– Primary column of access path

– Possible to separate with range

– History management column

7

1000 ~ 2000 2008-04

2000 ~ 3000

3000 ~ 4000

2008-05

2008-06

vs.

Page 8: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Hash Table

Make partition with hash value result which is applied hash function in Partition Key Column

Oracle doesn’t open hash function

User cannot know where rows is stored

Point of consideration

Verify that Range Partition can be applied

Verify Hash Partition Key Column distribution

Advantage

Disk IO distribution

Good performance in accessing 1 row

Reduce competition in index left leaf block

Profitable in parallel processing

8

Page 9: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Hash Table

9

Page 10: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

List Partition

Make use when user can know every value in column which has low cardinality

Select the column as Partition Key and make partition with equals values rows

Not range. Equal(=)

10

Page 11: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

List Partition

Disadvantage

Fixed Partition Key column value is possible

Partition available with only 1 column

Advantage

Make partition with Equal(=) value, Not Between value

Disk IO distribution

Benefit in history table management

Parallel Processing available

Solution of slow down in accessing 1 row

11

Page 12: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Composite Partition

Concept

Combination of two partition

e.g.) Range Partition + Hash Partition

Feature

Difficulty in management because large amount of partition will be made

Have advantages of two partitions

Good performance of accessing 1 row because of reducing index depth

Probability of whole disk access increases via disk IO distri-bution of hash partition

Optimize parallel processing

12

Page 13: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Composite Partition

13

Page 14: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Partition Index

Global Index & Local Index

Prefix Index & Nonprefix Index

14

Page 15: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Partition Index

Global Index

Index of the base table

Require index rebuild if partition is modified

15

Page 16: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Partition Index

Local Index

Index of the each partition table

Good for history table

Possible to concurrent work with each partition and index

16

Page 17: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Partition Index

Prefix Index

First index column == Index partition key

CREATE INDEX history_idx ON history(YYYYMMDD, SNN) GLOBAL PARTITON BY RANGE (YYYYMMDD) …

Good performance on query

Nonprefix Index

First index column != Index partition key

CREATE INDEX history_index on history(SSN) LOCAL

Bad performance on DML and query

Good performance with query with index column + nonpre-fix index

– SELECT num, item FROM history where num=‘133’ and YYYYM-MDD like ‘200402%’

17

Page 18: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Which index?

Global Prefix Index

Problem with management

– Need to rebuild index

Good performance

Global Nonprefix Index

Not exist

Change available to Local Prefix

Local Prefix Index

Good management

Good performance

Local Nonperfix Index

Good management

Bad performance

Use when access path is not table partition key

18

Page 19: Partition Architecture Yeon JongHeum 2008. 07. 18.

Copyright 2008 by CEBT

Which index?

19

Partition Index

Access withtable partition key?

Local Prefix Index

Global Index

Local Nonprefix Index

Managing history?

Possible tuningwith Table Partition Key?

Yes

Yes

Yes

No

No

No


Recommended