{
  "id": 17160261,
  "title": "pgvector: Embedding Column on the Table or a Separate Embeddings Table?",
  "url": "https://urgent.news/2026/10/30/pgvector-embedding-column-on-the-table-or-a-separate-embeddings-table",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-30T02:11:01.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/tbson87/pgvector-embedding-column-on-the-table-or-a-separate-embeddings-table-dc8"
  },
  "original_language": "en",
  "account": "The debate over whether to store embeddings in a separate table or as a column on the parent row in a database involves trade-offs in performance and flexibility. When an embedding is regenerated by a newer model, it is best to store it in its own table keyed by chunk and model. This allows for efficient updates without impacting other rows in the parent table.\n\nFor documents that are chunked, it is recommended to create a chunks table that holds the embedding alongside the chunk's position and text. This way, the embedding only changes when the text changes, which is when the embedding needs to change anyway.\n\nIf a single vector is associated with one entity and nothing else on that row is updated, then a vector column on the parent row can be used. This reduces the number of indexes involved and avoids unnecessary overhead from maintaining a separate table.\n\nIn general, it is advisable to store embeddings in a separate table when chunking or when re-embedding is expected. However, if there is exactly one vector per entity and no other updates occur on that row, storing the embedding as a column on the parent row is the optimal choice.\n\nThree main layouts cover the various cases:\n1. A vector column on the parent row along with a chunks table for chunked documents.\n2. A separate table specifically for chunk_embeddings, with a vector column keyed by chunk_id and model.\n3. Individual tables for each model, with untyped vector columns and partial indexes for mixed dimensions.\n\nThe choice between these layouts depends on the specific requirements of the RAG pipeline and the frequency of model changes.",
  "summary": "Disclosure: I build Schemity , a desktop ERD tool - this post is from our blog and uses it for the examples. TL;DR: Put the embedding where the row it describes is written least. A document that is chunked needs a chunks table anyway; an embedding that will be regenerated by a second model belongs in its own table keyed by chunk and model, with an untyped vector column. A vector column on a hot…",
  "key_points": [
    "Store embeddings in separate table when chunking or re-embedding expected.",
    "Use vector column on parent row for single entity per row with no updates.",
    "Three layouts: column+chunks table, separate chunkembeddings table, individual model tables."
  ],
  "editors_take": "Decoupling embeddings into separate tables provides the architectural flexibility needed for frequent model updates and document chunking, whereas inline columns prioritize simplicity for static, single-vector entities.",
  "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."
}