Opened 4 years ago

Closed 3 years ago

#617 closed enhancement (invalid)

rasql insert within an MDD object

Reported by: dmisev Owned by: dmisev
Priority: major Milestone: Future
Component: qlparser Version: development
Keywords: Cc: pcampalani, pbaumann
Complexity: Medium

Description (last modified by dmisev)

Inserting a slice in the middle of a 3D cube is possible via a partial update, e.g.

UPDATE 3Dcube AS c
SET c[ 5:*, *:*, *:* ] -- assuming shift position 5 in dimension 0
ASSIGN shift( c[ 5:*, *:*, *:* ], [1,0,0] )

The problem is that this is inefficient, as it requires updating a lot of data. This could be implemented efficiently without moving any data but just shifting some tile OIDs in the index.

Change History (8)

comment:1 Changed 4 years ago by dmisev

  • Description modified (diff)

comment:2 Changed 4 years ago by dmisev

  • Description modified (diff)

comment:3 Changed 4 years ago by dmisev

  • Description modified (diff)

comment:4 Changed 4 years ago by pbaumann

INSERT is used for inserting aon (oid,array) tuple, so such functionality would fit into partial UPDATE instead.
Isn't this already doable through something like

UPDATE 3Dcube AS c
SET c[ 5:*, *:*, *:* ] -- assuming shift position 5 in dimension 0
ASSIGN shift( c, [1,0,0] )
UPDATE 3Dcube AS c
SET c[ 5, *:*, *:* ] -- slot freed gets new values
ASSIGN shift( inv_tiff( $1 ), [5,*,*] )

or, in one query:

UPDATE 3Dcube AS c
SET c[ 5:*, *:*, *:* ]
ASSIGN
    concat(
        shift( inv_tiff( $1 ), [5,0,0] ),
        shift(c,[1,0,0])
    )
Last edited 4 years ago by pbaumann (previous) (diff)

comment:5 Changed 4 years ago by dmisev

Hey this actually works! I didn't expect it :) Note in the shift you need a trim as well:

UPDATE 3Dcube AS c
SET c[ 5:*, *:*, *:* ] -- assuming shift position 5 in dimension 0
ASSIGN shift( c[ 5:*, *:*, *:* ], [1,0,0] )

We just need to make this efficient, so that it doesn't require actual movement of the data.

comment:6 Changed 4 years ago by dmisev

  • Description modified (diff)

comment:7 Changed 4 years ago by pbaumann

...but care has to be taken that the tiling scheme is not violated. An interesting optimization problem: do the data shift with minimal tile updates in presence of some given tiling scheme.

comment:8 Changed 3 years ago by dmisev

  • Resolution set to invalid
  • Status changed from new to closed

I think such an optimization will not be possible in the general case, as the target domain can already have some data which needs to be overwritten, so moving just the index entry will not work. Closing ticket therefore.

Note: See TracTickets for help on using tickets.