perf(catalog): ERD neighbourhood and MCP describe/sample read the whole schema catalog; filter tables in SQL
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- dart, mysql, postgresql, sqlite
- Área
- databases, performance
Línea de trabajo
Start with lib/core/erd/erd_catalog.dart:198-248 and lib/core/mcp/mcp_query_service.dart:245-270, then inspect the columnsSql and viewColumnsSql definitions for PostgreSQL, MySQL, and SQLite. Trace how ERD neighbourhood names and MCP table validation flow into those queries, and review the related tests. Done means SQL filters catalog reads to the requested tables, MCP uses a cheap existence check where appropriate, and a neighbourhood remains complete beyond the catalog row limit.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
Two paths read the whole schema catalog when they need a few tables:
- ERD neighbourhood (
ErdCatalog.loadNeighbourhood,lib/core/erd/erd_catalog.dart:198-248). It loads all FKs (needed for the graph walk), then for every schema in the neighbourhood runscolumnsSqlfor all columns of that schema and filters in Dart (if (names.contains(r[0])),:230/:238). The PostgreSQLcolumnsSqlhas per-column correlated subqueries (unique-indexEXISTS,pg_enumstring_agg,col_description,pg_get_expr), so the cost grows with the schema, not with the diagram. WithcatalogRowLimit = 200000(:19) a large schema is truncated before filtering, so the focused table can lose its columns even though it needs only a few rows. - MCP
describe_table/sample_rows(McpQueryService._loadCatalog,lib/core/mcp/mcp_query_service.dart:245-270). To find one table it runs three catalog queries over the whole schema (columns, FKs, view columns) on every call.sample_rowsuses the result only to validate the table name.
Fix
- Add a table filter to
columnsSql/viewColumnsSql: PostgreSQLc.relname = ANY($names)per schema, MySQLtable_name IN (...), SQLitem.name IN (...)(literal-escaped as in_lit, or bind parameters where the delegate supports them). - ERD neighbourhood: walk FKs first, then fetch columns only for the resulting names.
- MCP: validate the name with a cheap existence query (
to_regclass/information_schema.tables/sqlite_master), and describe one table with the filtered column/FK queries. Keep the full catalog only forlist_tablesand theschema://resource. - Tests: the generated SQL contains the filter; the neighbourhood of a table in a schema larger than the row limit is complete.
Related: ERD epic #1166 and #1167 (same catalog SQL).
- Lenguaje dominante
- Dart
- Estrellas
- 23
- Forks
- 1
- Merge medio
- 31 min
- PR fusionados (30 d)
- 570
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de QueryaHub/Querya-Desktop
-
enhancement ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1689 ·
Los mantenedores suelen responder en 1 día
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowAbiertobug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
QueryaHub/Querya-Desktop#1642 ·
Los mantenedores suelen responder en 1 día
-
bug error-handling settings
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1637 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
QueryaHub/Querya-Desktop#1636 ·
Los mantenedores suelen responder en 1 día
-
enhancement marketplace
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1635 ·
Los mantenedores suelen responder en 1 día
Todos los issues de QueryaHub/Querya-Desktop
Issues similares
-
agent:in-progress agent:ready feature P2 · 中 区域: 悬浮窗
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
ASDW51/DanmuFloat#178 ·
Los mantenedores suelen responder en 1 día
-
Missing workoutsAbiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
InlitX/GymMane#237 · 1 comentario ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
AppFlowy-IO/AppFlowy#9077 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Abhinivesh2729/Thinai#41 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
0niel/university-app#617 ·
Los mantenedores suelen responder en 1 día