ydb

Is it possible to convert index type from async to sync for existing secondary index in YDB?


I've created a table in YDB with async index using following YQL statement:

(sql)
create table messages 
(
    chat_id uint64,
    user_id uint64,
    posted_at uint64,
    modifed_at Datetime,
    message_text Utf8,
    message_media Json,
    views_cnt Uint64,
    index idx_user_chat_posted global sync on (user_id, chat_id, posted_at),
    primary key(chat_id, posted_at, user_id)
)

Is it possible to convert index type from sync to async?


Solution

  • Currently YDB doesn't support index type change.

    Though it is possible to create async index on the same set of columns with ALTER TABLE statement.

    New async index will have another name and all the queries using sync index should be rewritten.