StripeLog

    Use this engine in scenarios when you need to write many tables with a small amount of data (less than 1 million rows).

    See the detailed description of the CREATE TABLE query.

    The engine stores all the columns in one file. For each INSERT query, ClickHouse appends the data block to the end of a table file, writing columns one by one.

    • index.mrk — File with marks. Marks contain offsets for each column of each data block inserted.

    The StripeLog engine does not support the ALTER UPDATE and operations.

    The file with marks allows ClickHouse to parallelize the reading of data. This means that a SELECT query returns rows in an unpredictable order. Use the ORDER BY clause to sort rows.

    Creating a table:

    1. CREATE TABLE stripe_log_table
    2. (
    3. timestamp DateTime,
    4. message String
    5. )
    6. ENGINE = StripeLog

    We used two INSERT queries to create two data blocks inside the data.bin file.

    ClickHouse uses multiple threads when selecting data. Each thread reads a separate data block and returns resulting rows independently as it finishes. As a result, the order of blocks of rows in the output does not match the order of the same blocks in the input in most cases. For example:

    Sorting the results (ascending order by default):