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: support specifying custom index parameters for geospatial indexes #52800

Merged
merged 1 commit into from Aug 18, 2020

Conversation

otan
Copy link
Contributor

@otan otan commented Aug 13, 2020

Release note (sql change): Introduced the s2_max_level, s2_level_mod
and s2_max_cells storage parameters for modifying the S2 parameters
for indexing GEOMETRY and GEOGRAPHY data types in an inverted index.

Release note (sql change): Introduced the geometry_min_x,
geometry_min_y, geometry_max_x, geometry_max_y storage parameters
for indexing GEOMETRY data types in an inverted index.

@otan otan requested review from sumeerbhola and a team August 13, 2020 21:15
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

Reviewed 10 of 10 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @otan)


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

		return a.applyS2ConfigSetting(evalCtx, key, expr, 0, 30)
	case `s2_level_mod`:
		return a.applyS2ConfigSetting(evalCtx, key, expr, 1, 30)

s2.RegionCoverer only supports LevelMod from 1...3.


pkg/sql/schemaexpr/partial_index.go, line 174 at r1 (raw file):

		if index.GeoConfig.S2Geometry != nil {
			if len(index.ColumnIDs) != 1 {

why should there be only 1 columnID? The first columnID is the inverted column, but there are also the PK columns.

Release note (sql change): Introduced the `s2_max_level`, `s2_level_mod`
and `s2_max_cells` storage parameters for modifying the S2 parameters
for indexing GEOMETRY and GEOGRAPHY data types in an inverted index.

Release note (sql change): Introduced the `geometry_min_x`,
`geometry_min_y`, `geometry_max_x`, `geometry_max_y` storage parameters
for indexing GEOMETRY data types in an inverted index.
Copy link
Contributor Author

@otan otan left a comment

Choose a reason for hiding this comment

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

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


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

Previously, sumeerbhola wrote…

s2.RegionCoverer only supports LevelMod from 1...3.

Fixed.


pkg/sql/schemaexpr/partial_index.go, line 174 at r1 (raw file):

Previously, sumeerbhola wrote…

why should there be only 1 columnID? The first columnID is the inverted column, but there are also the PK columns.

I think this is the way it is stored on the descriptor -- in which case this is the only column.

Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @sumeerbhola)

@otan
Copy link
Contributor Author

otan commented Aug 18, 2020

bors r=sumeerbhola

@craig
Copy link
Contributor

craig bot commented Aug 18, 2020

Build succeeded:

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.

None yet

3 participants