MariaDB vector migration plan $0.023
GPT-5.6 Sol 128k ▼
We store embeddings as packed float32 blobs in MariaDB. What's the cleanest migration path to the native VECTOR type, without downtime?
AI gpt-5.6-sol · 2.1s $0.011

The clean path is a shadow column migration: add the native column next to the blob, backfill in batches, then swap reads. No table rebuild, no downtime.

sql

    -- 1. Add the native column (instant, metadata-only)
    ALTER TABLE wp_mwai_local_vectors
      ADD COLUMN embedding_v VECTOR(1536) NULL;

    -- 2. Backfill in batches of 500
    UPDATE wp_mwai_local_vectors
      SET embedding_v = Vec_FromText(unpack_f32(embedding))
      WHERE embedding_v IS NULL LIMIT 500;

Once backfill completes, create the HNSW index concurrently and flip the query path behind a feature flag. Keep the blob column for one release as the rollback story.

Nice. And if the host runs MySQL instead of MariaDB?
AI gpt-5.6-sol · 1.4s $0.007

Then you keep the blob path: stock MySQL has no VECTOR type outside HeatWave. Detect the flavor at runtime and choose the strategy per site; the brute-force scan stays your universal fallback and is exact rather than approximate, which at typical knowledge-base sizes is actually the better result.

every model, your keys, your site.
GPT-5.6 Sol · est. $0.002 per message · shift+⏎ for a new line