Skip to content

Commit c6c0010

Browse files
authored
Dba 738 index optimization by llm (#64)
* Initial implementation of optimization by LLM
1 parent 5128504 commit c6c0010

File tree

15 files changed

+1965
-1060
lines changed

15 files changed

+1965
-1060
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ dependencies = [
1111
"pglast==7.2.0",
1212
"attrs>=25.3.0",
1313
"psycopg-pool>=3.2.6",
14+
"instructor>=1.7.9",
1415
]
1516
license = "mit"
1617
license-files = ["LICENSE"]

src/postgres_mcp/dta/__init__.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/postgres_mcp/explain/explain_plan.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from ..artifacts import ErrorResult
1111
from ..artifacts import ExplainPlanArtifact
12-
from ..sql import IndexConfig
12+
from ..sql import IndexDefinition
1313
from ..sql import SafeSqlDriver
1414
from ..sql import SqlBindParams
1515
from ..sql import check_postgres_version_requirement
@@ -114,7 +114,7 @@ async def explain_with_hypothetical_indexes(
114114

115115
# Convert the index definitions to IndexConfig objects
116116
indexes = frozenset(
117-
IndexConfig(
117+
IndexDefinition(
118118
table=idx["table"],
119119
columns=tuple(idx["columns"]),
120120
using=idx.get("using", "btree"),
@@ -185,7 +185,7 @@ async def _run_explain_query(self, query: str, analyze: bool = False, generic_pl
185185
async def generate_explain_plan_with_hypothetical_indexes(
186186
self,
187187
query_text: str,
188-
indexes: frozenset[IndexConfig],
188+
indexes: frozenset[IndexDefinition],
189189
use_generic_plan: bool = False,
190190
dta=None,
191191
) -> dict[str, Any]:

0 commit comments

Comments
 (0)