diff --git a/sdk/python/feast/infra/registry/sql.py b/sdk/python/feast/infra/registry/sql.py index b049adc898..d6a716e082 100644 --- a/sdk/python/feast/infra/registry/sql.py +++ b/sdk/python/feast/infra/registry/sql.py @@ -10,6 +10,7 @@ from sqlalchemy import ( # type: ignore BigInteger, Column, + Index, LargeBinary, MetaData, String, @@ -82,6 +83,8 @@ Column("project_proto", LargeBinary, nullable=False), ) +Index("idx_projects_project_id", projects.c.project_id) + entities = Table( "entities", metadata, @@ -91,6 +94,8 @@ Column("entity_proto", LargeBinary, nullable=False), ) +Index("idx_entities_project_id", entities.c.project_id) + data_sources = Table( "data_sources", metadata, @@ -100,6 +105,8 @@ Column("data_source_proto", LargeBinary, nullable=False), ) +Index("idx_data_sources_project_id", data_sources.c.project_id) + feature_views = Table( "feature_views", metadata, @@ -111,6 +118,8 @@ Column("user_metadata", LargeBinary, nullable=True), ) +Index("idx_feature_views_project_id", feature_views.c.project_id) + stream_feature_views = Table( "stream_feature_views", metadata, @@ -121,6 +130,8 @@ Column("user_metadata", LargeBinary, nullable=True), ) +Index("idx_stream_feature_views_project_id", stream_feature_views.c.project_id) + on_demand_feature_views = Table( "on_demand_feature_views", metadata, @@ -131,6 +142,8 @@ Column("user_metadata", LargeBinary, nullable=True), ) +Index("idx_on_demand_feature_views_project_id", on_demand_feature_views.c.project_id) + feature_services = Table( "feature_services", metadata, @@ -140,6 +153,8 @@ Column("feature_service_proto", LargeBinary, nullable=False), ) +Index("idx_feature_services_project_id", feature_services.c.project_id) + saved_datasets = Table( "saved_datasets", metadata, @@ -149,6 +164,8 @@ Column("saved_dataset_proto", LargeBinary, nullable=False), ) +Index("idx_saved_datasets_project_id", saved_datasets.c.project_id) + validation_references = Table( "validation_references", metadata, @@ -157,6 +174,7 @@ Column("last_updated_timestamp", BigInteger, nullable=False), Column("validation_reference_proto", LargeBinary, nullable=False), ) +Index("idx_validation_references_project_id", validation_references.c.project_id) managed_infra = Table( "managed_infra", @@ -167,6 +185,8 @@ Column("infra_proto", LargeBinary, nullable=False), ) +Index("idx_managed_infra_project_id", managed_infra.c.project_id) + permissions = Table( "permissions", metadata, @@ -176,6 +196,8 @@ Column("permission_proto", LargeBinary, nullable=False), ) +Index("idx_permissions_project_id", permissions.c.project_id) + class FeastMetadataKeys(Enum): LAST_UPDATED_TIMESTAMP = "last_updated_timestamp" @@ -191,6 +213,8 @@ class FeastMetadataKeys(Enum): Column("last_updated_timestamp", BigInteger, nullable=False), ) +Index("idx_feast_metadata_project_id", feast_metadata.c.project_id) + logger = logging.getLogger(__name__)