Analytics
Report on sales history in the same database as your live tables. Load it into a ColumnStore table beside your InnoDB tables and join them in one query.
The shop has been taking orders for a few months, and every Monday someone asks the same question: which products earned the most last week? The first answer is a GROUP BY against the order tables, and it works fine until the data grows. Then the report starts scanning millions of rows on the same tables that checkout writes to, and both of them slow down.
The tables aren't the problem. Their layout is. InnoDB, the default storage engine, keeps each row together on disk, which is exactly right for a checkout that reads or writes one order. A report wants the opposite. It reads two or three columns from every row and ignores the rest.
MariaDB ColumnStore stores each column on its own, so a report reads only the columns it names. Because every table in MariaDB Server chooses its own storage engine, the sales history can move to ColumnStore while products and orders stay on InnoDB, all in the same shop database. ColumnStore is open source and ships with MariaDB Community Server and MariaDB Enterprise Server.
Move Sales to ColumnStore
Create a ColumnStore Table
Add a sales table to the shop database with ENGINE=ColumnStore. ColumnStore tables don't use primary keys or indexes the way InnoDB tables do, because the engine scans compressed columns instead of looking up rows.
The ColumnStore quickstart explains how the engine stores and compresses each column.
Bulk Load With cpimport
The cpimport tool ships with ColumnStore and writes straight to the column files, skipping the SQL layer, which makes it the fastest way to load history. It reads pipe-delimited text by default, so write a small file on the server host and load it.
Reports keep running while the load is in progress. When your order history already lives in an InnoDB table, an INSERT INTO shop.sales SELECT ... statement run outside a transaction becomes the same bulk load. Data Loading with cpimport covers the file formats and options.
Join Across Engines
Revenue per product needs the sales figures from ColumnStore and the product names from InnoDB. One SELECT reads both.
ColumnStore reaches the InnoDB table through a cross-engine connection that you set up once with the mcsSetConfig CrossEngineSupport commands in Start and Configure ColumnStore.
With the sales history on ColumnStore, the Monday report reads a few compressed columns and leaves checkout alone. When the sales history outgrows one server, MariaDB Exa, part of MariaDB Enterprise Platform, runs analytics on a separate cluster. MaxScale CDC reads the binary log and loads each change into Exa, and you query the copy there, not in the same query as your InnoDB tables.
Keep Going
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

