it's a different firstColumn each time it's stored if you look carefully

On Thu, May 13, 2010 at 6:22 AM, Boris Shulman <shulm...@gmail.com> wrote:
> I see that the following code is used in order to create an index:
>
>      for (Iterator<IColumn> it = columns.iterator(); it.hasNext();)
>        {
>            column = it.next();
>            if (firstColumn == null)
>            {
>                firstColumn = column;
>                startPosition = endPosition;
>            }
>            endPosition += column.serializedSize();
>            /* if we hit the column index size that we have to index
> after, go ahead and index it. */
>            if (endPosition - startPosition >=
> DatabaseDescriptor.getColumnIndexSize())
>            {
>                IndexHelper.IndexInfo cIndexInfo = new
> IndexHelper.IndexInfo(firstColumn.name(), column.name(),
> startPosition, endPosition - startPosition);
>                indexList.add(cIndexInfo);
>                indexSizeInBytes += cIndexInfo.serializedSize();
>                firstColumn = null;
>            }
>        }
>
> According to this code the name of the first column is stored numerous
> times which can be very expensive in a large rows. I think that a
> better implementation is to have an Index Header that in turn will
> contain the name of the first column.
> Are there any plans to change this implementation? Is anyone aware of
> an open issue for it?
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Reply via email to