Successfully reported this slideshow.
Your SlideShare is downloading. ×

RedisGraph Internals: Roi Lipman

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
Graph Connect: Tuning Cypher
Graph Connect: Tuning Cypher
Loading in …3
×

Check these out next

1 of 73 Ad
Advertisement

More Related Content

More from Redis Labs (20)

Advertisement

Recently uploaded (20)

RedisGraph Internals: Roi Lipman

  1. 1. PRESENTED BY RedisGraph internals Roi Lipman RedisLabs, Lead developer
  2. 2. PRESENTED BY Query execution
 A-Z
  3. 3. PRESENTED BY “Query” Query transmission
  4. 4. PRESENTED BY AST construction
  5. 5. PRESENTED BY AST enrichment
  6. 6. PRESENTED BY Result Filter Scan Execution plan construction
  7. 7. PRESENTED BY Result Filter Scan Result-set Name Age Title Score
  8. 8. PRESENTED BY Execution plan
  9. 9. PRESENTED BY 1 Unwrap 2 Heat 3 Enjoy Popcorn
  10. 10. PRESENTED BY Result Filter Scan
  11. 11. PRESENTED BY Op
  12. 12. PRESENTED BY Op Generate
  13. 13. PRESENTED BY Op Consume
  14. 14. PRESENTED BY Op accumulate
  15. 15. PRESENTED BY Op Depleted
  16. 16. PRESENTED BY Op Reset
  17. 17. PRESENTED BY MATCH ( n )
 WHERE n.score > 85
 RETURN n
  18. 18. PRESENTED BY Result Filter Scan
  19. 19. PRESENTED BY Result Filter Scan
  20. 20. PRESENTED BY Result Filter Scan
  21. 21. PRESENTED BY Result Filter Scan
  22. 22. PRESENTED BY Result Filter Scan
  23. 23. PRESENTED BY Result Filter Scan
  24. 24. PRESENTED BY Result Filter Scan
  25. 25. PRESENTED BY Result Filter Scan
  26. 26. PRESENTED BY Result Filter Scan
  27. 27. PRESENTED BY Result Filter Scan
  28. 28. PRESENTED BY Result Filter Scan
  29. 29. PRESENTED BY Result Filter Scan
  30. 30. PRESENTED BY Result Filter Scan
  31. 31. PRESENTED BY Result Filter Scan
  32. 32. PRESENTED BY Execution plan construction
  33. 33. PRESENTED BY Result Filter Scan MATCH ( n )
 WHERE n.score > 85
 RETURN n
  34. 34. PRESENTED BY 1 Start simple 2 Optimise Execution plan construction
  35. 35. PRESENTED BY MATCH (X:person)-[:visit]->(S:state)
 WHERE state.population > 9M
 RETURN DISTINCT X, count(S) AS C ORDER BY C DESC
  36. 36. PRESENTED BY MATCH
 TraverseScan (X)
 (X)-[:visit]->(S)

  37. 37. PRESENTED BY WHERE TraverseScan state.population > 9M Filter
  38. 38. PRESENTED BY RETURN Traverse X, count(S) Filter Aggregate
  39. 39. PRESENTED BY RETURN Filter DISTINCT Aggregate Distinct
  40. 40. PRESENTED BY ORDER BY Aggregate C DESC Distinct Sort
  41. 41. PRESENTED BY Aggregate Distinct SortFilterTraverseScan Naive Execution plan
  42. 42. PRESENTED BY Aggregate Distinct SortFilterTraverseScan Redundant
  43. 43. PRESENTED BY Redundancy removed Aggregate SortFilterTraverseScan
  44. 44. PRESENTED BY Reverse traversal (X)->(S)(X) S.P > 9M FilterTraverseScan
  45. 45. PRESENTED BY Reverse traversal (S) S.P > 9M Filter (S)->(X) TraverseScan
  46. 46. PRESENTED BY Algebraic expression
  47. 47. PRESENTED BY MATCH ( a )-[ X ]->( b )-[ Y ]->( c )
 RETURN a,c
  48. 48. PRESENTED BY ( a )-[ X ]->( b )-[ Y ]->( c )
  49. 49. PRESENTED BY ( a )-[ X ]->( b )
  50. 50. PRESENTED BY X [ . 1 . 1 . 1 1 . . ] ( a ) ( b )
  51. 51. PRESENTED BY ( b )-[ Y ]->( c )
  52. 52. PRESENTED BY Y [ . 1 1 . . 1 . 1 . ] ( b ) ( c )
  53. 53. PRESENTED BY MATCH ( a )-[ X ]->( b )-[ Y ]->( c )
 RETURN a,c
  54. 54. PRESENTED BY Y [ . 1 1 . . 1 . 1 . ] b c [ . 1 . 1 . 1 1 . . ] X b a
  55. 55. PRESENTED BY [ . . 1 . 1 1 . 1 1] XY c a
  56. 56. PRESENTED BY Reversed traversal Aggregate SortTraverseFilterScan
  57. 57. PRESENTED BY Utilise index Aggregate SortTraverseFilterScan (S) S.P > 9M
  58. 58. PRESENTED BY Optimised execution plan Aggregate SortTraverse Index
 Scan
  59. 59. PRESENTED BY Naive VS Optimised 0 12.5 25 37.5 50 Naive Redundant 
 Distinct Early filter Utilise
 Index
  60. 60. Thank you!
  61. 61. PRESENTED BY 2D
  62. 62. PRESENTED BY MATCH ( a )-[ X ]->( b )-[ Y ]->( c )
 RETURN a,c
  63. 63. PRESENTED BY MATCH ( a )-[ X ]->( b )-[ Y ]->( c )
 RETURN a,b,c
  64. 64. PRESENTED BY 1 Single expression 2 Break down Expression construction
  65. 65. PRESENTED BY MATCH
 ( a )->( b )->( c )->( d )
 RETURN a,c,d
  66. 66. PRESENTED BY [AB] * [BC] * [CD]
  67. 67. PRESENTED BY [AB] * [BC] [CD] 1 2
  68. 68. PRESENTED BY [AB] * [BC] A B C
  69. 69. PRESENTED BY [C] [CD] C D
  70. 70. PRESENTED BY ()-[X]->()<-[Y]-()
  71. 71. PRESENTED BY
  72. 72. PRESENTED BY 1 Section 1 Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium. 2 Section 2 Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium. 3 Section 3 Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium. Agenda:
  73. 73. PRESENTED BY 1 Query parsing 2 AST enrichment, modification & validation 3 Execution plan construction, optimisation & invocation Steps 4 Result-set compaction & transmission

×