FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

perf: Added indexes to sql tables to optimize query execution by EXPEbdodla · Pull Request #4538 · feast-dev/feast · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
24 changes: 24 additions & 0 deletions sdk/python/feast/infra/registry/sql.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from sqlalchemy import ( # type: ignore
BigInteger,
Column,
Index,
LargeBinary,
MetaData,
String,
Expand Down Expand Up @@ -82,6 +83,8 @@
Column("project_proto", LargeBinary, nullable=False),
)

Index("idx_projects_project_id", projects.c.project_id)

entities = Table(
"entities",
metadata,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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",
Expand All @@ -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,
Expand All @@ -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"
Expand All @@ -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__)


Expand Down

Back | FazBrowse Home | New Git URL