asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mohiuddin Abdul Qader (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ASTERIXDB-1878) spatial_intersect function does not access the rtree index for some cases
Date Sat, 08 Apr 2017 01:38:41 GMT
Mohiuddin Abdul Qader created ASTERIXDB-1878:
------------------------------------------------

             Summary: spatial_intersect function does not access the rtree index for some
cases
                 Key: ASTERIXDB-1878
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1878
             Project: Apache AsterixDB
          Issue Type: Bug
          Components: Compiler, Optimizer
            Reporter: Mohiuddin Abdul Qader


For the following spatial Query where you check if the function returns true, the optimized
plan does not access the rtree index. 
Query:
for $tweet in dataset Tweets2 
where spatial_intersect ($tweet.sender-location, create-rectangle (  create-point( 30.0, 70.0
), create-point( 40.0, 80.0) = true)  )
return $tweet
Optimized Logical Plan:
distribute result [%0->$$0]
-- DISTRIBUTE_RESULT  |PARTITIONED|
  exchange
  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
    select (function-call: asterix:spatial-intersect, Args:[function-call: asterix:field-access-by-index,
Args:[%0->$$0, AInt32: {2}], null])
    -- STREAM_SELECT  |PARTITIONED|
      project ([$$0])
      -- STREAM_PROJECT  |PARTITIONED|
        exchange
        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
          data-scan []<-[$$8, $$0] <- nofilter:Tweets2
          -- DATASOURCE_SCAN  |PARTITIONED|
            exchange
            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
              empty-tuple-source
              -- EMPTY_TUPLE_SOURCE  |PARTITIONED|



If we do not check if its true, then it correctly accesses the rtree index: 
Query:
for $tweet in dataset Tweets2 
where spatial_intersect ($tweet.sender-location, create-rectangle (  create-point( 30.0, 70.0
), create-point( 40.0, 80.0))  )
return $tweet

Optimized Logical Plan:
distribute result [%0->$$0]
-- DISTRIBUTE_RESULT  |PARTITIONED|
  exchange
  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
    select (function-call: asterix:spatial-intersect, Args:[function-call: asterix:field-access-by-index,
Args:[%0->$$0, AInt32: {2}], ARectangle: { p1: APoint: { x: 30.0, y: 70.0 }, p2: APoint:
{ x: 40.0, y: 80.0 }}])
    -- STREAM_SELECT  |PARTITIONED|
      project ([$$0])
      -- STREAM_PROJECT  |PARTITIONED|
        exchange
        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
          unnest-map [$$7, $$0] <- function-call: asterix:index-search, Args:[AString:
{Tweets2}, AInt32: {0}, AString: {nofilter}, AString: {Tweets2}, ABoolean: {false}, ABoolean:
{false}, AInt32: {1}, %0->$$17, AInt32: {1}, %0->$$17, TRUE, TRUE, TRUE]
          -- BTREE_SEARCH  |PARTITIONED|
            exchange
            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
              order (ASC, %0->$$17) 
              -- STABLE_SORT [$$17(ASC)]  |PARTITIONED|
                exchange
                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                  project ([$$17])
                  -- STREAM_PROJECT  |PARTITIONED|
                    exchange
                    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                      unnest-map [$$13, $$14, $$15, $$16, $$17] <- function-call: asterix:index-search,
Args:[AString: {tweetSenderLocIndex}, AInt32: {1}, AString: {nofilter}, AString: {Tweets2},
ABoolean: {false}, ABoolean: {false}, AInt32: {4}, %0->$$9, %0->$$10, %0->$$11, %0->$$12]
                      -- RTREE_SEARCH  |PARTITIONED|
                        exchange
                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                          assign [$$9, $$10, $$11, $$12] <- [ADouble: {30.0}, ADouble:
{70.0}, ADouble: {40.0}, ADouble: {80.0}]
                          -- ASSIGN  |PARTITIONED|
                            empty-tuple-source
                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|





--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message