giorashc
giorashc

Reputation: 13713

Oracle : table with unused columns impact performance?

I have a table in my oracle db with 100 columns. 50 columns in this table are not used by the program accessing this table. (i.e. the select queries only select the relevant columns and NOT using '*')

My question is this : If I recreate the same table with only the columns I need will it improve queries performance using the same query I used with the original table (remember that only the relevant columns are selected)

It is well worth mentioning the the program makes these queries a reasonable amount of times per second!

P.S. : This is an existing project I am working on and the table design was made a long time ago for other products as well (thats why we have unused columns now)

Upvotes: 2

Views: 1293

Answers (1)

David Aldridge
David Aldridge

Reputation: 52386

So the effect of this will be that the average row will be smaller, if the extra columns have got data that will no longer be in the table. Therefore the table can be smaller, and not only will it use less space on disk it will use less memory space in the SGA, and caching will be more efficient.

Therefore, if you access the table via a full table scan then it will be faster to read the segment, but if you use index-based access mechanisms then the only performance improvement is likely to be through an improved chance of fetching the block from cache.

[Edited]

This SO thread suggests "it always pulls a tuple...". Hence, you are likely to see some performance improvement, not sure major or minor, as already mentioned.

Upvotes: 3

Related Questions