Compression and my Oracle OCD
I've been poking around with segment compression lately. I started looking into it whilst preparing my presentation for the Scotland OUG meeting, but now I've started playing with it, I can't stop. I want to know a little bit more every time, it's like an obsessive compulsion. I should probably seek help.
I hadn't realized that columns of length less than 6 don't get compressed, (until I read something Geoff Moss had written on the subject), so I just wanted to prove it to myself. So I created a table with one column, VARCHAR2(5), and populated it with 4194304 rows each containing 'XXXXX'.
Eh? What? I though the columns weren't supposed to be compressed?
Why's it smaller? What happened?
A fraction of a second later I remembered that altering a table "compress" also has the effect of setting pct_free to zero (it had previously been 10). And yes, the original 6380 blocks are now 638 fewer. The attempted compression did not compress anything.
Pretty obvious, but note that altering a table back to nocompress still leaves pct_free as zero. I mean, it would, wouldn't it.
When I did the same thing with a VARCHAR2(6) I did indeed get the compression I expected (not fantastic - the longer the column the more benefit, so I expected a poor compression ratio). My table went from 6266 blocks to 5758.
Now I want to see what the reason is for the 6 byte limit. Logically it must simply be that the reference to the value in the symbol table becomes longer that the original data, but given my Oracle Obsessive Compulsive Disorder I am now have to poke about with dumping blocks and look at the internal structure of the symbol table, compressed row data and so on, and so on. Not sure how I'll get on with that, but I'll keep you posted.
My apologies to anyone who stumbled upon this post looking for information about Oracle Configurator Developer, by the way.
I hadn't realized that columns of length less than 6 don't get compressed, (until I read something Geoff Moss had written on the subject), so I just wanted to prove it to myself. So I created a table with one column, VARCHAR2(5), and populated it with 4194304 rows each containing 'XXXXX'.
SQL> alter table test1 move;
Table altered.
SQL> select bytes/1048576 meg, blocks from dba_segments where segment_name='TEST1';
MEG BLOCKS
---------- ----------
49.84375 6380
SQL> alter table test1 move compress;
Table altered.
SQL> select bytes/1048576 meg, blocks from dba_segments where segment_name='TEST1';
MEG BLOCKS
---------- ----------
44.859375 5742
Eh? What? I though the columns weren't supposed to be compressed?
Why's it smaller? What happened?
A fraction of a second later I remembered that altering a table "compress" also has the effect of setting pct_free to zero (it had previously been 10). And yes, the original 6380 blocks are now 638 fewer. The attempted compression did not compress anything.
Pretty obvious, but note that altering a table back to nocompress still leaves pct_free as zero. I mean, it would, wouldn't it.
When I did the same thing with a VARCHAR2(6) I did indeed get the compression I expected (not fantastic - the longer the column the more benefit, so I expected a poor compression ratio). My table went from 6266 blocks to 5758.
Now I want to see what the reason is for the 6 byte limit. Logically it must simply be that the reference to the value in the symbol table becomes longer that the original data, but given my Oracle Obsessive Compulsive Disorder I am now have to poke about with dumping blocks and look at the internal structure of the symbol table, compressed row data and so on, and so on. Not sure how I'll get on with that, but I'll keep you posted.
My apologies to anyone who stumbled upon this post looking for information about Oracle Configurator Developer, by the way.

12 Comments:
Always nice to see someone else providing evidence that supports one's own!
;-)
Jeff
Simon,
It's 'Jeff', but I'm sure you already noticed that from his comment.
[sigh]
Cheers, Doug
My apologies! Apparently I was more interested in the technical detail than such trivia as the author's name! Sorry Jeff...!
I was the unlucky one who stumbled upon your blog looking out for O.C.D., article was interesting, but have you have ever tried to investigate why dear google ranks your page high enough when folks search on real OCD. ?
companies marketing mineral makeups and also get the best bargains in mineral makeup you can imagine,
find aout how to consolidate your students loans or just how to lower your actual rates.,
looking for breast enlargements? in Rochester,
homeopathy for eczema learn about it.,
Allergies, information about lipitor,
save big with great bargains in mineral makeup,
change edition interviewing motivational people preparing second,
interviewing motivational people preparing second time,
interviewing people motivational preparing for a second time,
black mold exposure,
black mold exposure symptoms,
black mold symptoms of exposure,
free job interview questions,
free job interview answers,
interview answers to get a job,
lookfor hair styles for fine thin hair,
search hair styles for fine thin hair,
hair styles for fine thin hair,
beach resort in the philippines,
great beach resort in the philippines,
luxury beach resort in the philippines,
iron garden gates, here,
iron garden gates,
wrought iron garden gates
, here,
wrought iron garden gates
,
You: The Owner's Manual: An Insider's Guide to the Body That Will Make You Healthier and Younger
,
eat eating mindless more than think we we why
,
texturizer,
texturizers here,
black hair texturizer,
find aout how care curly hair,
find about how to care curly hair,
care curly hair,
lipitor rash,
lipitor reactions,
new house ventura california,
the house new houston tx,
new house washington dc,
new house pa philadelphia,
san antonio tx house new,
house new pa philadelphia,
new house washington dc,
new house ventura california,
the house new houston tx,
house new san antonio tx,
the house new houston tx, that you are looking for,
new house ventura california, you need to buy,
new house washington dc,
house new pa philadelphia,
new house san antonio tx,
hair surgery transplant,
air filter allergy,
refurbished dell laptop computers,
hair surgery transplant,
air filter allergy,
refurbished dell laptop computers,
hair surgery transplant,
air filter allergy,
refurbished dell laptop computers,
chocolate esophagus heartburn study,
chocolate esophagus heartburn studybe informed,
digestion healing healthy heartburn natural preventing way,
digestion healing healthy heartburn natural preventing way,
sew skirts, 16simple styles you can make!,
sew what skirts 16 simple styles you,
rebates and discounts on sunsetter awnings,
sunsetter awnings discounts and rebates,
discount on sunsetter awnings
truck and bus tires 12r 22.5, get the best price,
tires truck and bus 12r 22.5 best price,
tires truck bus tires12r 22.5 best price,
plush car seat strap covers,
car seat strap covers,plush,
car seat strap, plush covers,
oscoda voip phone systems, the best!,
oscoda voip the phone system,
oscoda voip phone systems,
exterior iron gates,
oriental wrought iron gates,
powder coated iron garden fencing,
black mold exposure,
black mold symptoms of exposure,
wrought iron garden gates,
your next iron garden gates, here,
hair styles for fine thin hair,
search hair styles for fine thin hair,
night vision binoculars,
buy, night vision binoculars,
lipitor reactions,
lipitor reactions,
luxury beach resort in the philippines,
beach resort in the philippines,
homeopathy for baby eczema.,
homeopathy for baby eczema.,
save big with great mineral makeup bargains,
companies marketing mineral makeups,
prodam iphone praha,
Apple prodam iphone praha,
iphone clone cect manual,
manual for iphone clone cect,
fero 52 binoculars night vision,
fero 52 night vision,
best night vision binoculars,
buy, best night vision binoculars,
computer programs to make photo albums,
computer programs, make photo albums,
it is cool.
Obsessive-compulsive disorder Symptoms (OCD) means having behavior or thoughts that come over and over again and if these behavior or thoughts are not done then there is an anxious feeling of incompleteness. Some of the behaviors are normal everyday things, for example washing ones hands, checking doors or stoves, and some of the things can be unusual, counting to ten, counting while waiting for someone, hoarding money, or other similar things. http://www.buy-xanax-online-now.com/
Poker Freerolls & Poker Passwords Posted Daily. no deposit bonuses ... Tournament Name: Freeroll
Bonus password free sponsor
Facebook Poker Password Hack Free Download, Collection of Facebook Poker Password Coupon Code
online cash no deposit poker portal free money rules sponsors and password play poker free
bankroll Poker Bonus $25 Free 5 Free Poker Books. Bonus code
bonusy
poker-club free roll password. hello all im looking for the poker-club
za darmo poker internetowy Titan Poker Guide - $50 FREE - bonus code: ip50gratis - Exclusive weekly freerolls
bonuses without deposit no requirment
no deposit bonuses
no deposit Forgot Your Password? login: pass: Remember me betmost
Tonusy bez depu,promotion poker promocje owy poker online. Odbierz sw&oa cutr&oac ute;w bez free fepozytu
Online poker sign up bonus free is easy to yoy and we have to be. Way meke made poker withets all possible.
Victor Chandler oferuje sign up bonus instant. said as well done. Earn some money , wow i said and how horrible they were early.
Also had some comments anonymouse sign up poker bakroll and don't know how how get no deposit free signup poker bankrolls & bonuses.
Great day, sorry if spam.
This is just what I was looking for. The templates are a nice idea. Good Luck
more templates easy to download
hello thanks for this great information
viagra online
generic viagra
Post a Comment
<< Home