Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Do secondary indexes require that all rows have values for the indexed column?

avatar

Can I add a secondary index to a dynamic column defined as part of a view?

1 ACCEPTED SOLUTION

avatar
Super Guru

Two questions.

1) Yes if data is upsert via Phoenix. HBase does not store null values in cells, however, Phoenix enters some dummy/empty values in order to be able to select all rows associated with a column. There was a bug couple years that was fixed: PHOENIX-63.

2) No. Even dynamic columns are defined after the table in the FROM clause on a SELECT statement, they are just encoded binary and only understood at the runtime. Indexes are populated on CREATE INDEX on explicit columns. You could get creative by using a virtual column, but that would require more storage and some tricks on the actual SQL and performance may be bad.

View solution in original post

1 REPLY 1

avatar
Super Guru

Two questions.

1) Yes if data is upsert via Phoenix. HBase does not store null values in cells, however, Phoenix enters some dummy/empty values in order to be able to select all rows associated with a column. There was a bug couple years that was fixed: PHOENIX-63.

2) No. Even dynamic columns are defined after the table in the FROM clause on a SELECT statement, they are just encoded binary and only understood at the runtime. Indexes are populated on CREATE INDEX on explicit columns. You could get creative by using a virtual column, but that would require more storage and some tricks on the actual SQL and performance may be bad.