Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to understand why NullTable is bigger in size than Table, can anyone explain please?
NullTable:
LOAD
Null() as Field1,
Null() as Field2,
Null() as Field3,
Null() as Field4,
Null() as Field5,
Null() as Field6,
Null() as Field7,
Null() as Field8,
Null() as Field9,
Null() as Field10,
-1 as Field11
AutoGenerate 300000000
;
STORE NullTable into [NullTable.qvd];
DROP Table NullTable;
Table:
LOAD
-1 as Field1,
-1 as Field2,
-1 as Field3,
-1 as Field4,
-1 as Field5,
-1 as Field6,
-1 as Field7,
-1 as Field8,
-1 as Field9,
-1 as Field10,
-1 as Field11
AutoGenerate 300000000
;
STORE Table into [Table.qvd];
DROP Table Table;
Hi Max, You put up an quite an interesting observation. lets deduce the answer based on the space occupied by each character, the null value by default occupies a space of around 4 bytes in the SQL storage which is most probably the same for the qliksense as well. When comparing it with the varchar/integer input of the values like 1 or -1 that you have used, it takes up the space based on the length of the character like 1 has around 1 or even less bytes space accommodated to it as compared to 11 or 111 input.
Thus, the null input has around 4 bytes while a character (-1) has around 1 byte or even less, resulting in higher size of qvd of null as compared to table qvd.
Hi Max, You put up an quite an interesting observation. lets deduce the answer based on the space occupied by each character, the null value by default occupies a space of around 4 bytes in the SQL storage which is most probably the same for the qliksense as well. When comparing it with the varchar/integer input of the values like 1 or -1 that you have used, it takes up the space based on the length of the character like 1 has around 1 or even less bytes space accommodated to it as compared to 11 or 111 input.
Thus, the null input has around 4 bytes while a character (-1) has around 1 byte or even less, resulting in higher size of qvd of null as compared to table qvd.
Thank you very much for your answer, that clarifies a lot for me. So, I can conclude that is better to fill the null values with a character!. Thanks again.