Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-22839

ROW_FORMAT=COMPRESSED vs PAGE_COMPRESSION=1 - size comparison

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6
    • Server
    • None

    Description

      I have the following tables:

      Table1:
      row_format=DYNAMIC
      Size = 5.87 GB
      Index = 3.88 GB
      Free = 4 MB
      Avg Row Length = 197 B
      Rows = 38686411
      (Actual file size: 15359541248 bytes)

      .
      Table2:
      row_format=COMPRESSED key_block_size=8
      Size = 4.26 GB
      Index = 2.72 GB
      Free = 3.5 MB
      Avg Row Length = 86 B
      Rows = 83063985
      (Actual file size: 12448694272 bytes)

      .
      Both tables have some meta data (ints/enums) and a main text field (100% variable length, with user messages/comments).

      .
      As experiment, for Table1, I made the text column COMPRESSED (using pt-online-schema-change), and converted to:
      row_format=DYNAMIC `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=6

      It became like this:
      Size = 6.23 GB
      Index = 6.61 GB
      Free = 5 MB
      Avg Row Length = 173 B
      (Actual file size: 13988003840 bytes)

      .
      For Table2, using normal ALTER TABLE, I converted to:
      row_format=DYNAMIC `PAGE_COMPRESSED`=1 `PAGE_COMPRESSION_LEVEL`=9

      It became like this:
      Size = 12.59 GB
      Index = 7.06 GB
      Free = 4 MB
      Avg Row Length = 159 B
      (Actual file size: 21399339008 bytes)

      .
      These are values from information_schema.

      I understand that the actual file sizes don't matter so much (they can be sparse files),
      but looking at the Size/Index, the PAGE_COMPRESSED seems to be causing the tables to be bigger, rather than smaller.

      Table1 – From no compression at all, to be compressed, the data increased 1GB, and indexes doubled.
      (I wanted to compress the text field only, but the innodb default configs made pt-online-schema-change also put PAGE_COMPRESSED)

      Table2 – From ROW_FORMAT=COMPRESSED to maximum level of PAGE_COMPRESSION, both data and index increased considerably.

      Does it make sense that PAGE_COMPRESSION, even with level 9, is compressing less than ROW_FORMAT=COMPRESSED?

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              nunop Nuno
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.