What are analytics?
Analytics, also known as OLAP (Online Analytical Processing), refers to SQL queries with complex calculations (e.g., aggregations, string processing, arithmetic) over massive datasets. Unlike transactional queries (or OLTP, Online Transaction Processing) that read and write just a few rows per query and, therefore, complete in milliseconds, analytics queries routinely process billions and trillions of rows. In many use cases, analytics queries must be “real-time”, i.e., return a result in less than one second.Row-oriented vs. column-oriented storage
Such a level of performance can only be achieved with the right data “orientation”. Databases store data either row-oriented or column-oriented. In a row-oriented database, consecutive table rows are sequentially stored one after the other. This layout allows to retrieve rows quickly as the column values of each row are stored together. ClickHouse is a column-oriented database. In such systems, tables are stored as a collection of columns, i.e. the values of each column are stored sequentially one after the other. This layout makes it harder to restore single rows (as there are now gaps between the row values) but column operations such as filters or aggregation become much faster than in a row-oriented database. The difference is best explained with an example query running over 100 million rows of real-world anonymized web analytics data:

