perf(catalog): ERD neighbourhood and MCP describe/sample read the whole schema catalog; filter tables in SQL
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 42/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- dart, mysql, postgresql, sqlite
- Domaine
- databases, performance
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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).
- Langage dominant
- Dart
- Étoiles
- 23
- Forks
- 1
- Merge moyen
- 31 min
- PR mergées (30 j)
- 570
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de QueryaHub/Querya-Desktop
-
enhancement ui
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
QueryaHub/Querya-Desktop#1689 ·
Les mainteneurs répondent en général sous 1 jour
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowOuvertebug frontend
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
QueryaHub/Querya-Desktop#1642 ·
Les mainteneurs répondent en général sous 1 jour
-
bug error-handling settings
Difficulté 1/5 1-3 heures Accessibilité débutants 78/100
QueryaHub/Querya-Desktop#1637 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
QueryaHub/Querya-Desktop#1636 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement marketplace
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
QueryaHub/Querya-Desktop#1635 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de QueryaHub/Querya-Desktop
Issues similaires
-
[Bug] Web Guide has broken linksOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
AppFlowy-IO/AppFlowy#9075 ·
-
Paste asks for iOS paste permission because the default context menu ignores SystemContextMenuPeut-être pris @dorklein l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
maheshj01/searchfield#267 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
avdept/JellyBoxPlayer#375 ·
Les mainteneurs répondent en général sous 1 jour
-
bug good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
basictech01/uniun#300 ·
Les mainteneurs répondent en général sous 1 jour