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

sql: omit NOTICE about indexes not being partitioned for PARTITION ALL BY #59568

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

otan
Copy link
Contributor

@otan otan commented Jan 29, 2021

We previously would print a notice specifying that non-partitioned
indexes on partitioned tables may not be performant - however, this
notice does not apply for PARTITION ALL BY tables as they will be
implicitly added for all indexes.

Release note: None

@otan otan requested a review from ajstorm January 29, 2021 02:30
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@ajstorm ajstorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "as they will be implicitly added for all indexes." -> "as all of their indexes will be automatically partitioned"

Just nits - :lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @otan)


pkg/sql/create_index.go, line 422 at r1 (raw file):

	if n.n.PartitionByIndex == nil &&
		n.tableDesc.GetPrimaryIndex().GetPartitioning().NumColumns > 0 &&
		!n.tableDesc.IsPartitionAllBy() {

Nit: Can we add a comment here explaining why we exclude IsPartitionAllBy() here. It makes sense if you're familiar with PARTITION ALL, but if not, a small hint would help readability.


pkg/sql/create_table.go, line 254 at r1 (raw file):

		for _, def := range n.n.Defs {
			if d, ok := def.(*tree.IndexTableDef); ok {
				if d.PartitionByIndex == nil && !n.n.PartitionByTable.All {

Nit: Comment here too.

…L BY

We previously would print a notice specifying that non-partitioned
indexes on partitioned tables may not be performant - however, this
notice does not apply for PARTITION ALL BY tables as all of their
indexes will be automatically partitioned.

Release note: None
@otan
Copy link
Contributor Author

otan commented Feb 1, 2021

thanks

bors r=ajstorm

@craig
Copy link
Contributor

craig bot commented Feb 1, 2021

Build succeeded:

@craig craig bot merged commit e4ac407 into cockroachdb:master Feb 1, 2021
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

Successfully merging this pull request may close these issues.

3 participants