[ 
https://issues.apache.org/jira/browse/CASSANDRA-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042223#comment-13042223
 ] 

Jonathan Ellis commented on CASSANDRA-2617:
-------------------------------------------

bq. DROP INDEX ON <CF>.<COLUMN_OR_INDEX_NAME>

This approach is fine for the cli (since we expect to not need it much longer) 
but we need to be more forward-thinking for CQL. The reason that relational 
databases all do DROP based on index name is, indexes can cover multiple 
columns so the by-column approach doesn't generalize.

But, I understand the motivation here, because

bq. DROP INDEX <INDEX_NAME>

making this the only option right now would suck because we don't auto-generate 
an index name when none is provided. (We sort of do, to create a file name for 
the sstables, but this is not interchangable with an actual index name.)

I think the right thing to do here is to do some deeper surgery, and create 
index names when none is provided so that can be the only thing we check for 
DROP.

The default index name should be comparator.getString(info.name) + "_idx" *when 
creating new indexes.* When inflating old ones in CFMD.inflate, we should 
default them to ByteBufferUtil.bytesToHex(info.name) to preserve compatibility 
in CFMD.indexColumnFamilyName (see also the TODO there).

> Add "DROP INDEX" command to CQL
> -------------------------------
>
>                 Key: CASSANDRA-2617
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2617
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>             Fix For: 0.8.1
>
>         Attachments: CASSANDRA-2617.patch
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to