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

Optimize property fetching #31

Closed
rmagen opened this issue May 12, 2016 · 4 comments
Closed

Optimize property fetching #31

rmagen opened this issue May 12, 2016 · 4 comments

Comments

@rmagen
Copy link
Member

rmagen commented May 12, 2016

Current querying behavior

  • Vertex - fetch all properties + any "inner" edges and their properties.
  • Edge - fetch all properties + both vertices and their properties.
    • If a vertex's schema is of type 'ref', its properties will only be fetched when it passes through a UniGraphVertexPropertiesSideEffectStep, a step that comes before any step that uses properties, and issues a DeferredVertexQuery. This ensures that the vertices will only be queried if and when its needed (i.e. lazy loading).

Problems

  1. When an Element is queried, all its properties are fetched, whether or not they are needed by this traversal.
  2. When a Vertex is queried, all its "inner" edges are fetched, whether or not they are needed by this traversal.

This issue tries to solve problem 1. We should probably create another ticket for solving problem 2 in the future.

Solution suggestion

SearchQuery/SearchVertexQuery/DeferredVertexQuery should pass a list of property keys needed from the queried element. UniGraphPropertiesStepStrategy should provide the property lists to the querying steps by analyzing the traversal. Scenarios:

  1. No step in the traversal needs any property - empty list.
  2. Step(s) in the traversal need specific property(s) - property list.
  3. Step(s) in the traversal iterate over all properties - null list.
  4. Unknown (the strategy couldn't identify which properties are needed) - null list. ???

Next, when a Controller receives these queries it should only fetch the relavent properties, or not issue a query at all when possible.

@rmagen rmagen added this to the Unipop 0.3 milestone May 12, 2016
@rmagen rmagen changed the title Include properties in SearchQuery Optimize property fetching May 12, 2016
@GurRonen GurRonen modified the milestones: Unipop 0.3, Unipop 0.2 Jun 7, 2016
@rmagen rmagen removed the elastic2 label Jun 18, 2016
rmagen added a commit that referenced this issue Jun 26, 2016
…no propertyKeys are used.

This has brought some tests to fail, probably indicating a bug in PropertiesStrategy. #31
@rmagen
Copy link
Member Author

rmagen commented Jun 26, 2016

@seanbarzilay see the failing tests following my changes to an empty set (I accidentally commited this to master...)
Please fix the tests :)

@rmagen
Copy link
Member Author

rmagen commented Jun 26, 2016

Also, why does UniVertexStep query DeferredVertex immediately after the edge query? Doesn't this defeat the point of deferring?

@seanbarzilay
Copy link
Member

@rmagen if you know you need a certain property or all properties from a vertex than it doesn't matter when are you querying it's properties

@rmagen
Copy link
Member Author

rmagen commented Jun 27, 2016

It does because other steps might filter out the vertex before its needed. But
lets leave it as it is for now.. How about those failing tests? :)

On Jun 27 2016, at 7:56 am, sbarzilay <notifications@github.com> wrote:

@rmagen
if you know you need a certain property or all properties from a vertex than
it doesn't matter when are you querying it's properties


You are receiving this because you were mentioned.
Reply to this email directly, view it on
GitHub
,
or mute the
thread
.

@rmagen rmagen closed this as completed Jul 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants