Skip to content

Issue #425 Optimize spatial queries to use prepared geometries.#426

Merged
chrisbennight merged 1 commit intomasterfrom
SPATIALOPT
Jun 12, 2015
Merged

Issue #425 Optimize spatial queries to use prepared geometries.#426
chrisbennight merged 1 commit intomasterfrom
SPATIALOPT

Conversation

@rwgdrummer
Copy link
Copy Markdown
Contributor

The new approach also adds an optimization for the use of Interning geometries. The prior approach lead to excessive memory use due to the reconstitution of geometry PRIOR to interning, creating unnecessary duplicates.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"Interning a geometry provides no additional benefit since the geometry is already constructed in the heap at the interning begins" - I'm not quite sure the scope of the comment - do you mean interning geometries in general, interning geometries in addition to the byte[] value, etc? As I read it I disagree with this comment - or at a minimum it doesn't accurately convey the issue.
So the point of interning was to have one instance of a geometry object maintained as iterator state per JVM (or I guess classloader) instance. Since we could end up with tens of thousands of iterators per scan range a 2 MB geometry could explode into gigabytes of data, completely using up the head allocated to the tablet server.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A geometry is constructed first prior to interning. It consumes heap space before being released to its interned duplicate. This approach prevents a Geometry from being constructed if it already exists.

I will update the comment

@rwgdrummer rwgdrummer force-pushed the SPATIALOPT branch 2 times, most recently from a81dd62 to f3b94d9 Compare June 11, 2015 12:05
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

our formatter will change this line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will fix this prior to pull.

Issue #427 Zookeeper Transaction Allocator Unit Test Inconsistency
chrisbennight added a commit that referenced this pull request Jun 12, 2015
Issue #425 Optimize spatial queries to use prepared geometries.
@chrisbennight chrisbennight merged commit b43f6fa into master Jun 12, 2015
@chrisbennight chrisbennight deleted the SPATIALOPT branch June 27, 2015 15:16
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