Skip to content

[ATTRIBUTES] Avoid calling InitializeTables() on every tabular create operation #478

Description

@zaeema-n

Problem

InitializeTables() is invoked in the tabular create flow, so each create request performs schema-init checks for global metadata tables (entity_attributes, attribute_schemas).

Why this is bad

  • Adds unnecessary DB roundtrips on every create
  • Increases request latency and DB load
  • Mixes one-time infrastructure bootstrap with hot-path request handling

Current behavior
Per-request create path calls InitializeTables().

Expected behavior
InitializeTables() should run once at service startup/bootstrap, not per create request.

Proposed fix

  1. Remove InitializeTables() call from tabular CreateResolve request path
  2. Call InitializeTables() once during core startup after Postgres repo creation
  3. Ensure test/e2e bootstrap handles DB-reset scenarios (so startup-only init remains reliable)

Acceptance criteria

  • No InitializeTables() call in per-request tabular create path
  • Startup fails fast if initialization fails
  • Create requests no longer perform schema-init overhead
  • E2E still passes with explicit bootstrap/restart after DB reset

Relevant files

  • opengin/core-api/engine/attribute_resolver.go
  • opengin/core-api/cmd/server/service.go
  • opengin/core-api/db/repository/postgres/postgres_client.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions