Table size and sql performance [message #360737] |
Sun, 23 November 2008 17:47 |
djeevan
Messages: 1 Registered: November 2008
|
Junior Member |
|
|
How does the table size effects sql performance?
I am comparing 2 tables , with same number of rows(54 million rows) ,
table1(columns a,b,c,d,e,f..) has 40 columns
table2 (columns (a,b,c,d)
SQL uses columns a,b.
SQL using table2 runs in 1 sec.
SQL using table1 runs in 30 min.
Can any one please let me know how the table size , number of columns in table efects the performance of SQL's?
Thanks
jeevan.
|
|
|
|
Re: Table size and sql performance [message #360745 is a reply to message #360744] |
Sun, 23 November 2008 19:34 |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
Oracle stores rows in BLOCKS. The smallest piece of data that Oracle can read or write is a BLOCK, which may contain many rows.
If you rows are bigger, fewer rows will fit into a block. Even though the two SQLs read the same number of rows, one will read more blocks and therefore be slower.
Ross Leishman
|
|
|