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

Update "Computed Columns" page with examples of new multi-region columns and syntax #10401

Open
rmloveland opened this issue Apr 22, 2021 · 2 comments
Assignees

Comments

@rmloveland
Copy link
Contributor

rmloveland commented Apr 22, 2021

Richard Loveland (rmloveland) commented:

The Computed Columns page has an old skool partitioning example that is superseded by the new v21.1+ multi-region capabilities. However, computed columns can still be used with the new abstractions, as shown below.

Examples courtesy @rytaft in discussion on #10280.

-- This creates a computed column with the name cr.
CREATE TABLE t (
  id INT PRIMARY KEY,
  cr crdb_internal_region AS (
      CASE
        WHEN id <= 10 THEN 'us-east-1'
        ELSE 'ap-southeast-2'
      END
    ) STORED
) LOCALITY REGIONAL BY ROW AS "cr";

-- This creates a computed column with the the default name of `crdb_region`,
-- so there's no need to identify it with "AS".
CREATE TABLE t (
  id INT PRIMARY KEY,
  crdb_region crdb_internal_region AS (
      CASE
        WHEN id <= 10 THEN 'us-east-1'
        ELSE 'ap-southeast-2'
      END
    ) STORED
) LOCALITY REGIONAL BY ROW;

Jira Issue: DOC-1626

@rmloveland rmloveland self-assigned this Apr 22, 2021
@rmloveland rmloveland modified the milestone: 21.1 Apr 22, 2021
rmloveland added a commit that referenced this issue Apr 29, 2021
Fixes #9268
Fixes #9266
Fixes #9265
Fixes #9264
Fixes #10425
Fixes #10319

Addresses #10051
Addresses #10401
Addresses #10461
Addresses #10463

Summary of changes:

- Update multi-region "topology patterns" as follows:

  - Deemphasize "topology" for these patterns, since it really isn't -
    it's per-table

  - Add "global tables" as a pattern

  - Add "regional tables" as a pattern

  - Remove "duplicate indexes" and "geo-partitioned foos" pages and have
    them redirect to the above, as appropriate

  - Fix up ~all links in the docs to point to the new things

- Update mentions of partitioning throughout the docs to note that most
  users should use new v21.1+ multi-region capabilities instead of
  explicit partitioning

  - Also removed mention of partitioning from several places as part of
    deemphasing explicit partitioning generally, since most use cases
    are covered by MR abstractions

- Update `cockroach demo` to deemphasize partitioning and point to new
  MR things

- Update disaster recovery pages to mention most users of new
  deployments should just use multi-region survival goals

- Update various licensing docs to point to the new multi-region things

- Update replication reports to mention the new MR things, in lieu of
  further updates

- Renamed a bunch of links that used the phrase "geo-partitioning" to
  refer to the multi-region latency tutorial, which now goes by the name
  "Multi-Region Performance"

- Note: we explicitly did *not* touch anything related to the
  multi-region Flask app, since that work is happening via #10394
rmloveland added a commit that referenced this issue Apr 29, 2021
Fixes #9268
Fixes #9266
Fixes #9265
Fixes #9264
Fixes #10425
Fixes #10319

Addresses #10051
Addresses #10401
Addresses #10461
Addresses #10463

Summary of changes:

- Update multi-region "topology patterns" as follows:

  - Deemphasize "topology" for these patterns, since it really isn't -
    it's per-table

  - Add "global tables" as a pattern

  - Add "regional tables" as a pattern

  - Remove "duplicate indexes" and "geo-partitioned foos" pages and have
    them redirect to the above, as appropriate

  - Fix up ~all links in the docs to point to the new things

- Update mentions of partitioning throughout the docs to note that most
  users should use new v21.1+ multi-region capabilities instead of
  explicit partitioning

  - Also removed mention of partitioning from several places as part of
    deemphasing explicit partitioning generally, since most use cases
    are covered by MR abstractions

- Update `cockroach demo` to deemphasize partitioning and point to new
  MR things

- Update disaster recovery pages to mention most users of new
  deployments should just use multi-region survival goals

- Update various licensing docs to point to the new multi-region things

- Update replication reports to mention the new MR things, in lieu of
  further updates

- Renamed a bunch of links that used the phrase "geo-partitioning" to
  refer to the multi-region latency tutorial, which now goes by the name
  "Multi-Region Performance"

- Note: we explicitly did *not* touch anything related to the
  multi-region Flask app, since that work is happening via #10394
rmloveland added a commit that referenced this issue May 3, 2021
Fixes #9268
Fixes #9266
Fixes #9265
Fixes #9264
Fixes #10425
Fixes #10319

Addresses #10051
Addresses #10401
Addresses #10461
Addresses #10463

Summary of changes:

- Update multi-region "topology patterns" as follows:

  - Deemphasize "topology" for these patterns, since it really isn't -
    it's per-table

  - Add "global tables" as a pattern

  - Add "regional tables" as a pattern

  - Remove "duplicate indexes" and "geo-partitioned foos" pages and have
    them redirect to the above, as appropriate

  - Fix up ~all links in the docs to point to the new things

- Update mentions of partitioning throughout the docs to note that most
  users should use new v21.1+ multi-region capabilities instead of
  explicit partitioning

  - Also removed mention of partitioning from several places as part of
    deemphasing explicit partitioning generally, since most use cases
    are covered by MR abstractions

- Update `cockroach demo` to deemphasize partitioning and point to new
  MR things

- Update disaster recovery pages to mention most users of new
  deployments should just use multi-region survival goals

- Update various licensing docs to point to the new multi-region things

- Update replication reports to mention the new MR things, in lieu of
  further updates

- Renamed a bunch of links that used the phrase "geo-partitioning" to
  refer to the multi-region latency tutorial, which now goes by the name
  "Multi-Region Performance"

- Note: we explicitly did *not* touch anything related to the
  multi-region Flask app, since that work is happening via #10394
rmloveland added a commit that referenced this issue May 5, 2021
Fixes #9268
Fixes #9266
Fixes #9265
Fixes #9264
Fixes #10425
Fixes #10319

Addresses #10051
Addresses #10401
Addresses #10461
Addresses #10463

Summary of changes:

- Update "topology patterns" docs as follows:

  - Move them as a sub-section under "Multi-Region Capabilities", since
    they are mostly relevant to multi-region usage

  - Deemphasize "topology" for these patterns, since these are not
    network topologies, they are mostly per-table configurable behaviors

  - Add "global tables" to replace the "duplicate indexes" page

  - Add "regional tables" to replace the "geo-partitioned XYZ" pages

  - Fix up ~all links in the docs to point to the new things

- Update mentions of partitioning throughout the docs to note that most
  users should use the new v21.1+ multi-region capabilities instead of
  explicit partitioning

  - Also removed mention of partitioning from several places as part of
    deemphasing explicit partitioning generally, since most use cases
    are covered by multi-region abstractions

- Update the 'Cost-Based Optimizer' page to remove the old skool
  "nearest index" partitioning stuff, since now we have GLOBAL tables

  - This required removing links to the above from all the "enterprise
    features" lists and replacing with links to the new 'Multi-Region
    Capabilities' page

- Update `cockroach demo` to deemphasize partitioning and point to new
  multi-region things

- Update disaster recovery pages to mention most users of new
  deployments should just use multi-region survival goals

- Update various licensing docs to point to the new multi-region things

- Update replication reports to mention the new multi-region things, in
  lieu of further updates

- Renamed a bunch of links that used the phrase "geo-partitioning" to
  refer to the multi-region latency tutorial, which now goes by the name
  "Multi-Region Performance"

- Note: we explicitly did *not* touch anything related to the
  multi-region Flask app, since that work is happening via #10394
rmloveland added a commit that referenced this issue May 7, 2021
Fixes #9268
Fixes #9266
Fixes #9265
Fixes #9264
Fixes #10425
Fixes #10319

Addresses #10051
Addresses #10401
Addresses #10461
Addresses #10463

Summary of changes:

- Update "topology patterns" docs as follows:

  - Move them as a sub-section under "Multi-Region Capabilities", since
    they are mostly relevant to multi-region usage

  - Deemphasize "topology" for these patterns, since these are not
    network topologies, they are mostly per-table configurable behaviors

  - Add "global tables" to replace the "duplicate indexes" page

  - Add "regional tables" to replace the "geo-partitioned XYZ" pages

  - Fix up ~all links in the docs to point to the new things

- Update mentions of partitioning throughout the docs to note that most
  users should use the new v21.1+ multi-region capabilities instead of
  explicit partitioning

  - Also removed mention of partitioning from several places as part of
    deemphasing explicit partitioning generally, since most use cases
    are covered by multi-region abstractions

- Update the 'Cost-Based Optimizer' page to remove the old skool
  "nearest index" partitioning stuff, since now we have GLOBAL tables

  - This required removing links to the above from all the "enterprise
    features" lists and replacing with links to the new 'Multi-Region
    Capabilities' page

- Update `cockroach demo` to deemphasize partitioning and point to new
  multi-region things

- Update disaster recovery pages to mention most users of new
  deployments should just use multi-region survival goals

- Update various licensing docs to point to the new multi-region things

- Update replication reports to mention the new multi-region things, in
  lieu of further updates

- Renamed a bunch of links that used the phrase "geo-partitioning" to
  refer to the multi-region latency tutorial, which now goes by the name
  "Multi-Region Performance"

- Updated 'ALTER TABLE ... SET LOCALITY REGIONAL BY ROW' to include info
  about locality optimized search

- Note: we explicitly did *not* touch anything related to the
  multi-region Flask app, since that work is happening via #10394
rmloveland added a commit that referenced this issue May 10, 2021
Fixes #9268
Fixes #9266
Fixes #9265
Fixes #9264
Fixes #10425
Fixes #10319

Addresses #10051
Addresses #10401
Addresses #10461
Addresses #10463

Summary of changes:

- Update "topology patterns" docs as follows:

  - Move them as a sub-section under "Multi-Region Capabilities", since
    they are mostly relevant to multi-region usage

  - Deemphasize "topology" for these patterns, since these are not
    network topologies, they are mostly per-table configurable behaviors

  - Add "global tables" to replace the "duplicate indexes" page

  - Add "regional tables" to replace the "geo-partitioned XYZ" pages

  - Fix up ~all links in the docs to point to the new things

- Update mentions of partitioning throughout the docs to note that most
  users should use the new v21.1+ multi-region capabilities instead of
  explicit partitioning

  - Also removed mention of partitioning from several places as part of
    deemphasing explicit partitioning generally, since most use cases
    are covered by multi-region abstractions

- Update the 'Cost-Based Optimizer' page to remove the old skool
  "nearest index" partitioning stuff, since now we have GLOBAL tables

  - This required removing links to the above from all the "enterprise
    features" lists and replacing with links to the new 'Multi-Region
    Capabilities' page

- Update `cockroach demo` to deemphasize partitioning and point to new
  multi-region things

- Update disaster recovery pages to mention most users of new
  deployments should just use multi-region survival goals

- Update various licensing docs to point to the new multi-region things

- Update replication reports to mention the new multi-region things, in
  lieu of further updates

- Renamed a bunch of links that used the phrase "geo-partitioning" to
  refer to the multi-region latency tutorial, which now goes by the name
  "Multi-Region Performance"

- Updated 'ALTER TABLE ... SET LOCALITY REGIONAL BY ROW' to include info
  about locality optimized search

- Note: we explicitly did *not* touch anything related to the
  multi-region Flask app, since that work is happening via #10394
@github-actions
Copy link

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB docs!

@rytaft
Copy link
Contributor

rytaft commented Jul 26, 2023

I believe this is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants