Am assuming you have one matrix and you know the dimensions. Also as = you say the most important queries are to get an entire column or an entir= e row.

I would consider using a standard CF for t= he Columns and one for the Rows.  The key for each would be the col /= row number, each cassandra column name would be the id of the other dimen= sion and the value whatever you want.

- wh= en storing the data update both the Column and Row CF
- reading = a whole row/col would be simply reading from the appropriate CF.
- reading an intersection is a get_slice to either col or row CF using th= e column_names field to identify the other dimension.

=
You would not need secondary indexes to serve these queries.&nb= sp;

Hope that helps.
Aaron
On 10 Dec, 2010,at 07:02 AM, S=E9bastien Druon <sdruon@spo= tuse.com> wrote:

I mea= n if I have secondary indexes. Apparently they are calculated in the backg= round...

On 9 December 2010 18:33, David= Boxenhorn wrote:=
=0A
What do = you mean by indexing?

On Thu, Dec 9, 2010 at 7:30 PM, S=E9bastien Druon <sdruon@spotuse.com>= wrote:
=0A=0A
Thanks a lot for the answer

W= hat about the indexing when adding a new element? Is it incremental?
= =0A=0A

Thanks again

On 9 December 2010 14:38, David Boxenhorn wrote:<= br>=0A=0A=0A
How about a regular CF where keys are N@N ?
=
Then, getting a matrix row would be the same cost as getting a matrix = column (N gets), and it would be very easy to add element N+1.
=0A=0A=0A=

=0AOn Thu, Dec= 9, 2010 at 1:48 PM, S=E9bastien Druon wrote:
=0A=0A=0A=0AHello,
=
For a specific case, we are thinking about representing a N= to N relationship with a NxN Matrix in Cassandra.
The relations= will be only between a subset of elements, so the Matrix will mostly cont= ain empty elements.
=0A=0A=0A=0A=0A=0A

We have a s= et of questions concerning this:
- what is the best way to repre= sent this matrix? what would have the best performance in reading? in writ= ing?
. a super column family with n column families,= with n columns each
=0A=0A=0A=0A=0A=0A
. a column fa= mily with n columns and n lines

In the second cas= e, we would need to extract 2 kinds of information:
- all the re= lations for a line: this should be no specific problem;
=0A=0A=0A=0A=0A= =0A
- all the relations for a column: in that case we would need an in= dex for the columns, right? and then get all the lines where the value of = the column in question is not null... is it the correct way to do?
=0A=0A=0A=0A=0A=0AWhen using indexes, say we want to add another elemen= t N+1. What impact in terms of time would it have on the indexation job?

Thanks a lot for the answers,

=
Best regards,
=0A=0A=0A=0A=0A=0A

S=E9bastien Druon
=0A

=
=0A

=0A

=0A
=0A= --Apple-Webmail-86--bd3aa99e-0d1a-437e-d96c-a735b72a1e9e-- --Apple-Webmail-42--bd3aa99e-0d1a-437e-d96c-a735b72a1e9e--