CLUSTERED INDEX
CLUSTERED INDEX is a SQL statement in the Indexes category. Determines the physical order of rows in the table. Only one per table. SQL Server / MySQL (InnoDB PK is clustered). The syntax is CREATE CLUSTERED INDEX index_name ON table (column);. It returns clustered index. A typical example: -- SQL Server: explicit clustered index CREATE CLUSTERED INDEX idx_order_id ON orders (order_id); -- Rows are physically sorted by order_id -- MySQL: InnoDB PRIMARY KEY is the clustered index CREATE TABLE employees (id INT PRIMARY KEY, ...); -- Data is sorted by id on disk -- Clustered = fast range scans, slow inserts (may page split) A close relative is CREATE INDEX, which creates an index on one or more columns to speed up query performance. A close relative is DROP INDEX, which removes an existing index from a table. A close relative is COMPOSITE INDEX, which an index on multiple columns. Column order matters — queries use leftmost prefix.