Skip to content
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

Interleaving deprecation #10154

Merged
merged 7 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Within a single [transaction](transactions.html):

- DDL statements cannot be mixed with DML statements. As a workaround, you can split the statements into separate transactions. For more details, [see examples of unsupported statements](online-schema-changes.html#examples-of-statements-that-fail).
- As of version v2.1, you can run schema changes inside the same transaction as a [`CREATE TABLE`](create-table.html) statement. For more information, [see this example](online-schema-changes.html#run-schema-changes-inside-a-transaction-with-create-table).
- A `CREATE TABLE` statement containing [`FOREIGN KEY`](foreign-key.html) or [`INTERLEAVE`](interleave-in-parent.html) clauses cannot be followed by statements that reference the new table.
- A `CREATE TABLE` statement containing a [`FOREIGN KEY`](foreign-key.html) constraint cannot be followed by statements that reference the new table.
- Database, schema, table, and user-defined type names cannot be reused. For example, you cannot drop a table named `a` and then create (or rename) a different table with the name `a`. Similarly, you cannot rename a database named `a` to `b` and then create (or rename) a different database with the name `a`. As a workaround, split `RENAME TO`, `DROP`, and `CREATE` statements that reuse object names into separate transactions.
- [Schema change DDL statements inside a multi-statement transaction can fail while other statements succeed](#schema-change-ddl-statements-inside-a-multi-statement-transaction-can-fail-while-other-statements-succeed).
- As of v19.1, some schema changes can be used in combination in a single `ALTER TABLE` statement. For a list of commands that can be combined, see [`ALTER TABLE`](alter-table.html). For a demonstration, see [Add and rename columns atomically](rename-column.html#add-and-rename-columns-atomically).
Expand Down
1 change: 1 addition & 0 deletions _includes/v20.2/misc/interleave-deprecation-note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{site.data.alerts.callout_warning}}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.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Within a single [transaction](transactions.html):

- DDL statements cannot be mixed with DML statements. As a workaround, you can split the statements into separate transactions. For more details, [see examples of unsupported statements](online-schema-changes.html#examples-of-statements-that-fail).
- As of version v2.1, you can run schema changes inside the same transaction as a [`CREATE TABLE`](create-table.html) statement. For more information, [see this example](online-schema-changes.html#run-schema-changes-inside-a-transaction-with-create-table).
- A `CREATE TABLE` statement containing [`FOREIGN KEY`](foreign-key.html) or [`INTERLEAVE`](interleave-in-parent.html) clauses cannot be followed by statements that reference the new table.
- A `CREATE TABLE` statement containing a [`FOREIGN KEY`](foreign-key.html) clause cannot be followed by statements that reference the new table.
- Database, schema, table, and user-defined type names cannot be reused. For example, you cannot drop a table named `a` and then create (or rename) a different table with the name `a`. Similarly, you cannot rename a database named `a` to `b` and then create (or rename) a different database with the name `a`. As a workaround, split `RENAME TO`, `DROP`, and `CREATE` statements that reuse object names into separate transactions.
- [Schema change DDL statements inside a multi-statement transaction can fail while other statements succeed](#schema-change-ddl-statements-inside-a-multi-statement-transaction-can-fail-while-other-statements-succeed).
- As of v19.1, some schema changes can be used in combination in a single `ALTER TABLE` statement. For a list of commands that can be combined, see [`ALTER TABLE`](alter-table.html). For a demonstration, see [Add and rename columns atomically](rename-column.html#add-and-rename-columns-atomically).
Expand Down
1 change: 1 addition & 0 deletions _includes/v21.1/misc/interleave-deprecation-note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{site.data.alerts.callout_warning}}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
1 change: 0 additions & 1 deletion v20.2/backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ Object | Depends On
Table with [foreign key](foreign-key.html) constraints | The table it `REFERENCES`; however, this dependency can be [removed during the restore](restore.html#skip_missing_foreign_keys).
Table with a [sequence](create-sequence.html) | The sequence it uses; however, this dependency can be [removed during the restore](restore.html#skip_missing_sequences).
[Views](views.html) | The tables used in the view's `SELECT` statement.
[Interleaved tables](interleave-in-parent.html) | The parent table in the [interleaved hierarchy](interleave-in-parent.html#interleaved-hierarchy).

### Users and privileges

Expand Down
1 change: 0 additions & 1 deletion v20.2/cockroach-workload.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ 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`
`--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
Loading