Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Partitioning techniques with respect to performance tuning:

KEY BASED TECHNIQUES: 1.HASH 2.MODULUS 3.RANGE 4.DB/2 KEYLESS TECHNIQUES:1.same 2.entire 3.Round Robin 4.Random All Key Based stages by default are assosciated with hash as keybased technique. Hash technique:Principle of Partitioning:-Same key column values are given to same node Suppose there are 3 nodes N1,N2,N3 HASH TECHNIQUE Column1 Column2 Column3

INPUT DATA 10 20 10 30 20 10 30 20 10 20 30

RECORDS FETCHED BY RECORDS FETCHED BY RECORDS FETCHED BY N1 N2 N3 10 10 10 10 20 20 20 20 30 30 30

Hash partitioning technique can be selected in 2 cases No of key columns > 1 No of keycolumns =1 ,(other than Integer) Round Robin:The first record goes to the first processing node, the second goes to the second processing node and so on. When it reaches the last node, then loading starts from the first node once again. In general this method of partitioning creates approximately equal sized partitions. ROUNDROBIN Column1 RECORDS FETCHED BY N1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 4 7 10 13 16 19 Column2 RECORDS FETCHED BY N2 2 5 8 11 14 17 Column3 RECORDS FETCHED BY N3 3 6 9 12 15 18

INPUT DATA

Random:Records are randomly distributed across all processing nodes. Random partitioning also creates approximately equal sized partitions, but the data is partitioned in a random format.

ROUNDROBIN

Column1 RECORDS FETCHED BY N1

Column2 RECORDS FETCHED BY N2 2 12 11 5 15 19 13

Column3 RECORDS FETCHED BY N3 10 4 6 3 20 17

INPUT DATA 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

1 9 8 7 14 18 16

Modulus:Modulus is having good performance when compared to hash. Principle of Partitioning:It Distributes the Data by calculating the MOD value. MOD Value= (Value/No of partitions or nodes) Mod is selected ,when it has only 1 key column and it is an integer.

MODULUS

Column1 RECORDS FETCHED BY N1 0 3 2 1 0 2 3 2 1 1 0 3 0 3

Column2 RECORDS FETCHED BY N2 1 1 1

Column3 RECORDS FETCHED BY N3 2 2 2

INPUT DATA

Modulus technique is used when the key column is numeric type.this is the only difference between hash and modulus technique.

You might also like