Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

perf(catalog): ERD neighbourhood and MCP describe/sample read the whole schema catalog; filter tables in SQL

Ouverte
#1,572 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

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

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

backend core P3 performance

Problem

Two paths read the whole schema catalog when they need a few tables:

  1. 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 runs columnsSql for all columns of that schema and filters in Dart (if (names.contains(r[0])), :230/:238). The PostgreSQL columnsSql has per-column correlated subqueries (unique-index EXISTS, pg_enum string_agg, col_description, pg_get_expr), so the cost grows with the schema, not with the diagram. With catalogRowLimit = 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.
  2. 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_rows uses the result only to validate the table name.

Fix

  • Add a table filter to columnsSql / viewColumnsSql: PostgreSQL c.relname = ANY($names) per schema, MySQL table_name IN (...), SQLite m.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 for list_tables and the schema:// 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

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de QueryaHub/Querya-Desktop

Toutes les issues de QueryaHub/Querya-Desktop

Issues similaires

Plus d'issues Dart

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.