Skip to content

Interleaving deprecation #10154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions _includes/v20.2/faq/when-to-interleave-tables.html

This file was deleted.

2 changes: 2 additions & 0 deletions _includes/v20.2/misc/interleave-deprecation-note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{site.data.alerts.callout_danger}}Interleaving is deprecated in CockroachDB v20.2. For details, see [`INTERLEAVE IN PARENT` Deprecation](interleave-in-parent.html#deprecation).
{{site.data.alerts.end}}
32 changes: 0 additions & 32 deletions _includes/v20.2/sql/diagrams/opt_interleave.html

This file was deleted.

5 changes: 0 additions & 5 deletions _includes/v21.1/faq/when-to-interleave-tables.html

This file was deleted.

2 changes: 2 additions & 0 deletions _includes/v21.1/misc/interleave-deprecation-note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{site.data.alerts.callout_danger}}Interleaving was deprecated in CockroachDB v20.2, and is disabled by default in CockroachDB v21.1. For details, see [`INTERLEAVE IN PARENT` Deprecation](interleave-in-parent.html#deprecation).
{{site.data.alerts.end}}
32 changes: 0 additions & 32 deletions _includes/v21.1/sql/generated/diagrams/opt_interleave.html

This file was deleted.

2 changes: 1 addition & 1 deletion releases/v20.1.13.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $ docker pull cockroachdb/cockroach:v20.1.13
- Previously, if [`RELEASE SAVEPOINT cockroach_restart`](../v20.1/release-savepoint.html#commit-a-transaction-by-releasing-a-retry-savepoint) was followed by [`ROLLBACK`](../v20.1/rollback-transaction.html), the `sql.txn.rollback.count` metric would be incremented. This was incorrect, because the transaction had already committed. The metric is no longer incremented in this case. [#60251][#60251]
- Fixed a bug where an error in protecting a record could be incorrectly reported, preventing some backups of very large tables from succeeding. [#60961][#60961]
- Fixed a bug where high-latency global clusters could sometimes fall behind in [resolving timestamps for changefeeds](../v20.1/create-changefeed.html#messages). [#60926][#60926]
- Creating [interleaved](../v20.1/interleave-in-parent.html) partitioned indexes is now disallowed. Previously, the database would crash when trying to create one. Note that [interleaved tables will be deprecated altogether](../v20.2/interleave-in-parent.html#convert-interleaved-tables-to-non-interleaved-tables) in a future release. [#61423][#61423]
- Creating [interleaved](../v20.1/interleave-in-parent.html) partitioned indexes is now disallowed. Previously, the database would crash when trying to create one. Note that [interleaved tables will be deprecated altogether](../v20.2/interleave-in-parent.html#deprecation) in a future release. [#61423][#61423]
- In the Advanced Debugging section of the Admin UI (DB Console), manually enqueueing a range to the garbage collection (GC) queue now properly respects the `SkipShouldQueue` option. This ensures that you can force the GC of a specific range. [#60746][#60746]

### Contributors
Expand Down
4 changes: 2 additions & 2 deletions releases/v20.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ Before [upgrading to CockroachDB v20.2](../v20.2/upgrade-cockroach-version.html)
- Cross-database references are deprecated in v20.2 (see [tracking issue](https://github.com/cockroachdb/cockroach/issues/55791)). In v20.2, creating cross-database references is disabled for [foreign keys](../v20.2/foreign-key.html), [views](../v20.2/views.html), and [sequence ownership](../v20.2/create-sequence.html) with the `sql.cross_db_fks.enabled`, `sql.cross_db_views.enabled`, and `sql.cross_db_sequence_owners.enabled` [cluster settings](../v20.2/cluster-settings.html) set to `false` by default. Note that any cross-database references that were created prior to a v20.2 upgrade are still allowed and are unaffected by these cluster settings.

After upgrading to v20.2, we recommend removing all cross-database references, and, if necessary, creating object references across user-defined schemas instead. For details on migrating a cluster that does not use user-defined schemas in its naming hierarchy, see [Migrating namespaces from previous versions of CockroachDB](../v20.2/sql-name-resolution.html#migrating-namespaces-from-previous-versions-of-cockroachdb).
- [Interleaved tables](../v20.2/interleave-in-parent.html) will be deprecated in a future release.
- [Interleaved tables](../v20.2/interleave-in-parent.html) are deprecated in CockroachDB v20.2, and will be permanently disabled in a future release (see [tracking issue](https://github.com/cockroachdb/cockroach/issues/52009)).

After upgrading to v20.2, we recommend that you convert any existing interleaved tables to non-interleaved tables and replace any existing interleaved secondary indexes with non-interleaved indexes. For instructions, see [Convert interleaved tables to non-interleaved tables](../v20.2/interleave-in-parent.html#convert-interleaved-tables-to-non-interleaved-tables).
After upgrading to v20.2, we recommend that you convert any existing interleaved tables to non-interleaved tables and replace any existing interleaved secondary indexes with non-interleaved indexes. For instructions, see [`INTERLEAVE IN PARENT` Deprecation](../v20.2/interleave-in-parent.html#deprecation).

### Known limitations

Expand Down
2 changes: 1 addition & 1 deletion v20.2/alter-primary-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ To change an existing primary key without creating a secondary index from that p
-----------|-------------
`table_name` | The name of the table with the primary key that you want to modify.
`index_params` | The name of the column(s) that you want to use for the primary key. These columns replace the current primary key column(s).
`opt_interleave` | You can potentially optimize query performance by [interleaving tables](interleave-in-parent.html), which changes how CockroachDB stores your data.<br>{{site.data.alerts.callout_info}}[Hash-sharded indexes](hash-sharded-indexes.html) cannot be interleaved.{{site.data.alerts.end}}
`USING HASH WITH BUCKET COUNT` | Creates a [hash-sharded index](hash-sharded-indexes.html) with `n_buckets` number of buckets.<br>{{site.data.alerts.callout_info}}To enable hash-sharded indexes, set the `experimental_enable_hash_sharded_indexes` [session variable](set-vars.html) to `on`.{{site.data.alerts.end}}
`opt_interleave` | [Interleave table into parent object](interleave-in-parent.html).<br>{% include {{ page.version.version }}/misc/interleave-deprecation-note.md %}

## Required privileges

Expand Down
2 changes: 1 addition & 1 deletion v20.2/cockroach-workload.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Flag | Description
`--fks` | Add foreign keys.<br><br>**Applicable commands:** `init` or `run`<br>**Default:** `true`
`--histograms` | The file to write per-op incremental and cumulative histogram data to.<br><br>**Applicable command:** `run`
`--init` | **Deprecated.** Use the `init` command instead.<br><br>**Applicable command:** `run`
`--interleaved` | Use [interleaved tables](interleave-in-parent.html).<br><br>**Applicable commands:** `init` or `run`
`--interleaved` | Use [interleaved tables](interleave-in-parent.html).<br><br>**Applicable commands:** `init` or `run`<br>{% include {{ page.version.version }}/misc/interleave-deprecation-note.md %}
`--max-ops` | The maximum number of operations to run.<br><br>**Applicable command:** `run`
`--max-rate` | The maximum frequency of operations (reads/writes).<br><br>**Applicable command:** `run`<br>**Default:** `0`, which means unlimited.
`--mix` | Weights for the transaction mix.<br><br>**Applicable commands:** `init` or `run`<br>**Default:** `newOrder=10,payment=10,orderStatus=1,delivery=1,stockLevel=1`, which matches the [TPC-C specification](http://www.tpc.org/tpc_documents_current_versions/current_specifications.asp).
Expand Down
2 changes: 0 additions & 2 deletions v20.2/cost-based-optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ If it is not possible to use the algorithm specified in the hint, an error is si


{{site.data.alerts.callout_info}}
With queries on [interleaved tables](interleave-in-parent.html), the optimizer might choose to use a merge join to perform a [foreign key](foreign-key.html) check when a lookup join would be more optimal.

<span class="version-tag">New in v20.2:</span> To make the optimizer prefer lookup joins to merge joins when performing foreign key checks, set the `prefer_lookup_joins_for_fks` [session variable](set-vars.html) to `on`.
{{site.data.alerts.end}}

Expand Down
2 changes: 1 addition & 1 deletion v20.2/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ Parameter | Description
`column_name` | The name of the column you want to index.
`ASC` or `DESC`| Sort the column in ascending (`ASC`) or descending (`DESC`) order in the index. How columns are sorted affects query results, particularly when using `LIMIT`.<br><br>__Default:__ `ASC`
`STORING ...`| Store (but do not sort) each column whose name you include.<br><br>For information on when to use `STORING`, see [Store Columns](#store-columns). Note that columns that are part of a table's [`PRIMARY KEY`](primary-key.html) cannot be specified as `STORING` columns in secondary indexes on the table.<br><br>`COVERING` and `INCLUDE` are aliases for `STORING` and work identically.
`opt_interleave` | You can potentially optimize query performance by [interleaving indexes](interleave-in-parent.html), which changes how CockroachDB stores your data.<br>{{site.data.alerts.callout_info}}[Hash-sharded indexes](hash-sharded-indexes.html) cannot be interleaved.{{site.data.alerts.end}}
`opt_partition_by` | An [enterprise-only](enterprise-licensing.html) option that lets you [define index partitions at the row level](partitioning.html).
`opt_where_clause` | <span class="version-tag">New in v20.2:</span> An optional `WHERE` clause that defines the predicate boolean expression of a [partial index](partial-indexes.html).
`USING HASH WITH BUCKET COUNT` | Creates a [hash-sharded index](hash-sharded-indexes.html) with `n_buckets` number of buckets.<br>{{site.data.alerts.callout_info}}To enable hash-sharded indexes, set the `experimental_enable_hash_sharded_indexes` [session variable](set-vars.html) to `on`.{{site.data.alerts.end}}
`WITH storage_parameter` | <span class="version-tag">New in v20.2:</span> A comma-separated list of [spatial index tuning parameters](spatial-indexes.html#index-tuning-parameters). Supported parameters include `fillfactor`, `s2_max_level`, `s2_level_mod`, `s2_max_cells`, `geometry_min_x`, `geometry_max_x`, `geometry_min_y`, and `geometry_max_y`. The `fillfactor` parameter is a no-op, allowed for PostgreSQL-compatibility.<br><br>For details, see [Spatial index tuning parameters](spatial-indexes.html#index-tuning-parameters). For an example, see [Create a spatial index that uses all of the tuning parameters](spatial-indexes.html#create-a-spatial-index-that-uses-all-of-the-tuning-parameters).
`CONCURRENTLY` | Optional, no-op syntax for PostgreSQL compatibility. All indexes are created concurrently in CockroachDB.
`opt_interleave` | [Interleave index into parent object](interleave-in-parent.html).<br>{% include {{ page.version.version }}/misc/interleave-deprecation-note.md %}

## Viewing schema changes

Expand Down
5 changes: 2 additions & 3 deletions v20.2/create-table-as.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ table td:first-child {

## Limitations

Tables created with `CREATE TABLE ... AS` are not [interleaved](interleave-in-parent.html) with other tables.
The default rules for [column families](column-families.html) apply.
- The default rules for [column families](column-families.html) apply.

The [primary key](primary-key.html) of tables created with `CREATE TABLE ... AS` is not automatically derived from the query results. You must specify new primary keys at table creation. For examples, see [Specify a primary key](create-table-as.html#specify-a-primary-key) and [Specify a primary key for partitioning](create-table-as.html#specify-a-primary-key-for-partitioning).
- The [primary key](primary-key.html) of tables created with `CREATE TABLE ... AS` is not automatically derived from the query results. You must specify new primary keys at table creation. For examples, see [Specify a primary key](create-table-as.html#specify-a-primary-key) and [Specify a primary key for partitioning](create-table-as.html#specify-a-primary-key-for-partitioning).

## Examples

Expand Down
9 changes: 2 additions & 7 deletions v20.2/create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ The user must have the `CREATE` [privilege](authorization.html#assign-privileges
{% include {{ page.version.version }}/sql/diagrams/like_table_option_list.html %}
</div>

**opt_interleave ::=**

<div>
{% include {{ page.version.version }}/sql/diagrams/opt_interleave.html %}
</div>

**opt_with_storage_parameter_list ::=**

Expand All @@ -100,11 +95,11 @@ Parameter | Description
`family_def` | An optional, comma-separated list of [column family definitions](column-families.html). Column family names must be unique within the table but can have the same name as columns, constraints, or indexes.<br><br>A column family is a group of columns that are stored as a single key-value pair in the underlying key-value store. CockroachDB automatically groups columns into families to ensure efficient storage and performance. However, there are cases when you may want to manually assign columns to families. For more details, see [Column Families](column-families.html).
`table_constraint` | An optional, comma-separated list of [table-level constraints](constraints.html). Constraint names must be unique within the table but can have the same name as columns, column families, or indexes.
`LIKE table_name like_table_option_list` | <span class="version-tag">New in v20.2:</span> Create a new table based on the schema of an existing table, using supported specifiers. For details, see [Create a table like an existing table](#create-a-table-like-an-existing-table). For examples, see [Create a new table from an existing one](#create-a-new-table-from-an-existing-one).
`opt_interleave` | You can potentially optimize query performance by [interleaving tables](interleave-in-parent.html), which changes how CockroachDB stores your data.<br>{{site.data.alerts.callout_info}}[Hash-sharded indexes](hash-sharded-indexes.html) cannot be interleaved.{{site.data.alerts.end}}
`opt_partition_by` | An [enterprise-only](enterprise-licensing.html) option that lets you define table partitions at the row level. You can define table partitions by list or by range. See [Define Table Partitions](partitioning.html) for more information.
`opt_where_clause` | <span class="version-tag">New in v20.2:</span> An optional `WHERE` clause that defines the predicate boolean expression of a [partial index](partial-indexes.html).
`opt_with_storage_parameter_list` | <span class="version-tag">New in v20.2:</span> A comma-separated list of [spatial index tuning parameters](spatial-indexes.html#index-tuning-parameters). Supported parameters include `fillfactor`, `s2_max_level`, `s2_level_mod`, `s2_max_cells`, `geometry_min_x`, `geometry_max_x`, `geometry_min_y`, and `geometry_max_y`. The `fillfactor` parameter is a no-op, allowed for PostgreSQL-compatibility.<br><br>For details, see [Spatial index tuning parameters](spatial-indexes.html#index-tuning-parameters). For an example, see [Create a spatial index that uses all of the tuning parameters](spatial-indexes.html#create-a-spatial-index-that-uses-all-of-the-tuning-parameters).
`ON COMMIT PRESERVE ROWS` | This clause is a no-op, allowed by the parser for PostgresSQL compatibility. CockroachDB only supports session-scoped [temporary tables](temporary-tables.html), and does not support the clauses `ON COMMIT DELETE ROWS` and `ON COMMIT DROP`, which are used to define transaction-scoped temporary tables in PostgreSQL.
`opt_interleave` | [Interleave table into parent table](interleave-in-parent.html).<br>{% include {{ page.version.version }}/misc/interleave-deprecation-note.md %}

## Table-level replication

Expand All @@ -131,7 +126,7 @@ The following options are supported:
To exclude specifiers, use the `EXCLUDING` keyword. Excluding specifiers can be useful if you want to use `INCLUDING ALL`, and exclude just one or two specifiers. The last `INCLUDING`/`EXCLUDING` keyword for a given specifier takes priority.

{{site.data.alerts.callout_info}}
Column families, interleavings, partitioning, and foreign key constraints
Column families, partitioning, interleavings, and foreign key constraints
cannot be preserved from the old table and will have to be recreated
manually in the new table if the user wishes.
{{site.data.alerts.end}}
Expand Down
Loading