en.wikipedia.org/wiki/Database_index
2 corrections found
When multiple databases and multiple tables are joined, it is called a cluster
In database systems, a cluster is not a join of multiple databases and tables. It is a storage/schema object that groups one or more tables together physically by a shared cluster key.
Full reasoning
This sentence misdefines a database cluster in the context used by the rest of the section.
Oracle's SQL reference defines a cluster as "a schema object that contains data from one or more tables". It further explains that Oracle stores together rows from tables that share the same cluster key. That means a cluster is a physical storage organization feature, not the act of joining multiple databases or tables in a query.
So the incorrect part is the description of a cluster as something that happens when databases/tables are joined. A SQL join is a query operation; a cluster is a database object/layout mechanism.
1 source
- Oracle Database SQL Language Reference — CREATE CLUSTER
A cluster is a schema object that contains data from one or more tables. An indexed cluster must contain more than one table... Oracle Database stores together all the rows from all the tables that share the same cluster key.
The primary index is created automatically when the table is created in the database.
Creating a table does not automatically create a primary index in general. Official database docs say indexes are created automatically only for specific constraints such as PRIMARY KEY or UNIQUE, not merely because a table was created.
Full reasoning
This statement is too broad and is false as written.
Official PostgreSQL documentation says CREATE TABLE creates a new table, and that PostgreSQL automatically creates an index for each unique constraint and primary key constraint. In other words, the automatic index creation is tied to declaring a PRIMARY KEY or UNIQUE constraint, not to table creation by itself.
SQLite's documentation says the same thing in a different way: a table created with CREATE TABLE AS has no PRIMARY KEY and no constraints of any kind, and in most cases, UNIQUE and PRIMARY KEY constraints are implemented by creating a unique index. That again shows index creation depends on the presence of those constraints, not simply on the existence of a new table.
So the article's claim that the primary index is created automatically when the table is created is misleading. Many tables are created with no automatically created primary index at all.
2 sources
- PostgreSQL Documentation — CREATE TABLE
CREATE TABLE will create a new, initially empty table... PostgreSQL automatically creates an index for each unique constraint and primary key constraint to enforce uniqueness.
- SQLite Documentation — CREATE TABLE
A table created using CREATE TABLE AS has no PRIMARY KEY and no constraints of any kind... In most cases, UNIQUE and PRIMARY KEY constraints are implemented by creating a unique index in the database.