Syntax for multiple index arrays


The examples in the user guide use a single array index.

What is the syntax if I want to use two?

For example in the SciDb user guide (v14.3) the following is used to redimension winnersFlat…

store(redimension (project (index_lookup(winnersFlat,event_index,winnersFlat.event, event_id), year,person,time,event_id),winners), winners);

What if the ‘Year’ dimension was indexed as well…

create array year_index <year:string>[year_id=0:*,10,0]; store(uniq(sort(project(winnersFlat,year)),'chunk_size=10'),year_index);

How would I apply this second index to create a target array like this…

{year_id,event_id} person,time {0,0} 'Bailey',9.84 {0,1} 'Thugwane',7956



Hi Mike,

You can nest index_lookup calls. For example:

a <a1, a2, a3...>

index_lookup( index_lookup ( a, a1_index_array, a1, a1_index), a2_index_array, a2, a2_index) ...