xmltype as secure file with compress
i am using 11g
CREATE TABLE EX_COMPRESS
( id NUMBER, xml_document XMLType
) XMLTYPE COLUMN xml_document STORE AS SECUREFILE BINARY XML(COMPRESS HIGH)
CREATE TABLE EX_NOCOMPRESS
( id NUMBER, xml_document XMLType
) XMLTYPE COLUMN xml_document STORE AS SECUREFILE BINARY XML(NOCOMPRESS)
SELECT segment_name, bytes
FROM user_segments
WHERE segment_name IN('EX_COMPRESS','EX_NOCOMPRESS')
BEGIN
FOR i IN 1 .. 1000 LOOP
INSERT INTO EX_COMPRESS
VALUES (I,
XMLType(bfilename('MYDIRECT', 'purchaseorder.xml'),
nls_charset_id('AL32UTF9')));
INSERT INTO EX_NOCOMPRESS
VALUES (I,
XMLType(bfilename('MYDIRECT', 'purchaseorder.xml'),
nls_charset_id('AL32UTF9')));
END LOOP;
COMMIT;
END;
SELECT segment_name, bytes
FROM user_segments
WHERE segment_name IN('EX_COMPRESS','EX_NOCOMPRESS')
o/p is
segment_name BYTES
........................
EX_COMPRESS 917504
EX_NOCOMPRESS 720896
in the o/p for compress no bytes for compress is more comapre to nocompress why it happend?
normally for compress no bytes less compare to nocompress