Closed LuckySting closed 3 months ago
YDB supports secondary indexes over the table, which may be used to optimize the selection of data.
This PR contains the dialect features to declare and usage of YDB Secondary Indexes within SQLAlchemy Index and hints.
Index
hints
sa.Index("my_index", table.c.c2, ydb_async=True, ydb_cover=["c3"])
is rendered as
ALTER TABLE table ADD INDEX my_index GLOBAL ASYNC ON (c2) COVER (c3);
sa.select( sa.column(table.c.c1) ) .select_from(table) .where(sa.column(table.c.c2) == 1) .with_hint(table, "VIEW `my_index`")
SELECT c1 FROM table VIEW `my_index` WHERE c2 == 1
Description
YDB supports secondary indexes over the table, which may be used to optimize the selection of data.
In this PR
This PR contains the dialect features to declare and usage of YDB Secondary Indexes within SQLAlchemy
Index
andhints
.Example
Declaration
is rendered as
Usage
is rendered as