v.23.10New Feature

Introduce create_table_empty_primary_key_by_default setting for default ORDER BY ()

Introduce a setting create_table_empty_primary_key_by_default for default ORDER BY (). #55899 (Srikanth Chekuri).
Introduce a new setting create_table_empty_primary_key_by_default to enable creating tables with ORDER BY () as the default sorting key.

Why it matters

This feature allows users to create tables without a primary key or sorting key by default, which can be useful for scenarios where sorting is unnecessary or to optimize write performance by avoiding sorting overhead.

How to use it

Set the create_table_empty_primary_key_by_default setting to 1 to enable tables to be created with an empty ORDER BY clause by default. This can be done by adding the setting in the server configuration or specifying it in the session settings. For example:

SET create_table_empty_primary_key_by_default = 1;
CREATE TABLE example_table (
id UInt32,
value String
) ENGINE = MergeTree();
-- This table will have ORDER BY () by default.