Does scidb suupport append operation?


#1

tks for your help


#2

Hello,

Yes it does. At the moment, most insert / append needs to be large volumes for the system to be efficient. For example, do not perform a million single-cell inserts.

For some examples, please see:
viewtopic.php?f=11&t=1147&p=2169&hilit=append#p2169
viewtopic.php?f=18&t=1280&p=2597&hilit=insert+redimension#p2597


#3

[quote=“apoliakov”]Hello,

Yes it does. At the moment, most insert / append needs to be large volumes for the system to be efficient. For example, do not perform a million single-cell inserts.

For some examples, please see:
viewtopic.php?f=11&t=1147&p=2169&hilit=append#p2169
viewtopic.php?f=18&t=1280&p=2597&hilit=insert+redimension#p2597[/quote]

tks


#4

[quote=“apoliakov”]Hello,

Yes it does. At the moment, most insert / append needs to be large volumes for the system to be efficient. For example, do not perform a million single-cell inserts.

For some examples, please see:
viewtopic.php?f=11&t=1147&p=2169&hilit=append#p2169
viewtopic.php?f=18&t=1280&p=2597&hilit=insert+redimension#p2597[/quote]
for example, just as below
create array testappend id:int64,name:string[i=0:*,1000,0];
loadcsv.py -a ‘testappend’ -i ‘test.csv’(the content in test.csv is
1,a
2,b
3,c)
i just want to append a new data(4.d) to testappend.
after that,
scan(testappend) that can hava output as below
{0}1,a
{1}2,b
{2}3,c
{3}4,d
how can i do that? :laughing:

furthermore, if i want to modify the array,mking it just become below:
{0}1,a
{1}2,b
{2}3,sss
{3}4,d

tks for your help!! :smiley:


#5

Sure. This is what the code looks like:

$ iquery -aq "create array testappend <id:int64,name:string>[i=0:*,1000,0];"
Query was executed successfully

$ iquery -aq "store(build(testappend, '[(1,\'a\'),(2,\'b\'),(3,\'c\')]', true), testappend)"
{i} id,name
{0} 1,'a'
{1} 2,'b'
{2} 3,'c'

$ iquery -aq "insert(redimension(build(<i:int64, id:int64, name:string>[x=0:0,1,0], '[(3,4,\'d\')]',true),testappend),testappend)"
{i} id,name
{0} 1,'a'
{1} 2,'b'
{2} 3,'c'
{3} 4,'d'

$ iquery -aq "insert(redimension(build(<i:int64, id:int64, name:string>[x=0:0,1,0], '[(2,3,\'ssss\')]',true),testappend),testappend)"
{i} id,name
{0} 1,'a'
{1} 2,'b'
{2} 3,'ssss'
{3} 4,'d'

But bear in mind, scidb is designed for bulk inserts. Too many small inserts will incur a large storage overhead. 14.7 will handle this better and allow you to delete old versions of arrays. Hope it helps!


#6

[quote=“apoliakov”]Sure. This is what the code looks like:

$ iquery -aq "create array testappend <id:int64,name:string>[i=0:*,1000,0];"
Query was executed successfully

$ iquery -aq "store(build(testappend, '[(1,\'a\'),(2,\'b\'),(3,\'c\')]', true), testappend)"
{i} id,name
{0} 1,'a'
{1} 2,'b'
{2} 3,'c'

$ iquery -aq "insert(redimension(build(<i:int64, id:int64, name:string>[x=0:0,1,0], '[(3,4,\'d\')]',true),testappend),testappend)"
{i} id,name
{0} 1,'a'
{1} 2,'b'
{2} 3,'c'
{3} 4,'d'

$ iquery -aq "insert(redimension(build(<i:int64, id:int64, name:string>[x=0:0,1,0], '[(2,3,\'ssss\')]',true),testappend),testappend)"
{i} id,name
{0} 1,'a'
{1} 2,'b'
{2} 3,'ssss'
{3} 4,'d'

But bear in mind, scidb is designed for bulk inserts. Too many small inserts will incur a large storage overhead. 14.7 will handle this better and allow you to delete old versions of arrays. Hope it helps![/quote]

tks