I just tried to create an index on a column for a table with 200M rows.
Creating the index timed out:
0: jdbc:phoenix:172.31.31.143> CREATE INDEX idx_lastname ON loadtest.testing (lastname);
Error: Operation timed out (state=TIM01,code=6000)
java.sql.SQLTimeoutException: Operation timed out
at org.apache.phoenix.exception.SQLExceptionCode$14.newException(SQLExceptionCode.java:314)
at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:133)
I bumped up the timeout and tried again, but it failed, and it tells me
the index already exists:
0: jdbc:phoenix:172.31.31.143> CREATE INDEX idx_lastname ON loadtest.testing (lastname);
Error: ERROR 1013 (42M04): Table already exists. tableName=LOADTEST.IDX_LASTNAME (state=42M04,code=1013)
org.apache.phoenix.schema.TableAlreadyExistsException: ERROR 1013 (42M04): Table already
exists. tableName=LOADTEST.IDX_LASTNAME
at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1692)
at org.apache.phoenix.schema.MetaDataClient.createIndex(MetaDataClient.java:1118)
at org.apache.phoenix.compile.CreateIndexCompiler$1.execute(CreateIndexCompiler.java:95)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:280)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:272)
at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:271)
at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1063)
at sqlline.Commands.execute(Commands.java:822)
at sqlline.Commands.sql(Commands.java:732)
at sqlline.SqlLine.dispatch(SqlLine.java:808)
at sqlline.SqlLine.begin(SqlLine.java:681)
at sqlline.SqlLine.start(SqlLine.java:398)
at sqlline.SqlLine.main(SqlLine.java:292)
0: jdbc:phoenix:172.31.31.143> !indexes loadtest.testing
+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+-----------------+------------------------------------------+------------+---------------------------+
| TABLE_CAT | TABLE_SCHEM
| TABLE_NAME | NON_UNIQUE | INDEX_QUALIFIER
| INDEX_NAME | TYPE | ORDINAL_POSIT |
+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+-----------------+------------------------------------------+------------+---------------------------+
| | LOADTEST
| TESTING | true |
| IDX_LASTNAME | 3 | 1
|
| | LOADTEST
| TESTING | true |
| IDX_LASTNAME | 3 | 2
|
+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+-----------------+------------------------------------------+------------+---------------------------+
0: jdbc:phoenix:172.31.31.143>
Is this a bug? I don't really see how the index can be in a usable
state. If I 'explain' a query that ought to use the index, it tells me
it's going to do a full scan anyway.
James
|