{
  "id": 682688,
  "title": "Putting a 200-Table Schema Into a Prompt",
  "url": "https://urgent.news/2026/08/12/putting-a-200-table-schema-into-a-prompt",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-12T17:21:23.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/multigrid/putting-a-200-table-schema-into-a-prompt-387f"
  },
  "original_language": "en",
  "account": "A two-stage prompt design is recommended for handling a 200-table schema. In the first stage, create a catalogue of the tables, including their names, column names, types, and foreign keys, but exclude any constraints, indexes, or trailing clauses. This catalogue should be roughly 5,000 tokens in length. In the second stage, given a question, identify the smallest set of tables required to answer it, along with any additional tables needed for joining. This catalogue-based approach is more efficient than sending the full schema every time, which would result in 16,000 tokens of near-uniform text competing with the actual question for the model's attention. The catalogue is stored alongside migrations in the repository and should be updated whenever the schema changes, as it becomes stale when the schema evolves.",
  "summary": "A 200-table schema does not fit usefully in a prompt, even when it fits in the context window. The design that works is a two-stage one — a cheap call that picks the tables, a second call that sees only those tables in full — and a read-only guarantee that lives in the database rather than in the prompt. The arithmetic that forces the design Start by counting rather than guessing. Take a schema…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}