Opened 4 years ago

Last modified 4 years ago

#2371 new defect

slow marray query on small subset

Reported by: Dimitar Misev Owned by:
Priority: major Milestone: 10.0
Component: qlparser Version: 9.8
Keywords: Cc: Peter Baumann, Vlad Merticariu
Complexity: Medium

Description

Script is attached to reproduce a slow marray query which constructs a 3x20x20 array:

SELECT encode(

  MARRAY T1 in [0:2,0:19,2392:2411]
  VALUES  c.0[T1[0],T1[1],T1[2]] -

          CONDENSE max
          OVER pt in [0:2]
          USING c.0[pt[0],T1[1],T1[2]]

, "csv" ) FROM coll AS c

Equivalent query with max_cells instead of condense shows the same behavior:

SELECT encode(

  MARRAY T1 in [0:2,0:19,2392:2411]
  VALUES  c.0[T1[0],T1[1],T1[2]] -

          max_cells( c.0[0:2,T1[1],T1[2]] )

, "csv" ) FROM coll AS c

Attachments (1)

test.tar.gz (4.9 KB ) - added by Dimitar Misev 4 years ago.
run ./test.sh ingest the first time to setup the data

Download all attachments as: .zip

Change History (2)

by Dimitar Misev, 4 years ago

Attachment: test.tar.gz added

run ./test.sh ingest the first time to setup the data

comment:1 by Dimitar Misev, 4 years ago

The problem is that in an expression like c.0[T1[0],T1[1],T1[2]], the .0 is first applied on the whole array c, then subset is applied.

The workaround is to write c[T1[0],T1[1],T1[2]].0, it works fast as expected in this case.

Note: See TracTickets for help on using tickets.