OpenMetadata/bootstrap/sql/migrations/native/1.11.9/mysql/schemaChanges.sql
Sriharsha Chintalapani b244798f22
Add bulk apis for pipeline status (#25731)
* Add bulk apis for pipeline status

* Update generated TypeScript types

* Fix gitar comments

* Update generated TypeScript types

* Fix pycheck

* Address comments

* Fix databricks test

* Move schema changes to 1.11.9

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: harshsoni2024 <harshsoni2024@gmail.com>
2026-02-10 18:14:06 +05:30

11 lines
881 B
SQL

-- Change entity_extension_time_series.timestamp from VIRTUAL to STORED for performance.
-- STORED columns are materialized on disk, making unique constraint checks and range
-- queries on timestamp significantly faster (especially for bulk pipeline status upserts).
-- MySQL does not allow ALTER from VIRTUAL to STORED directly, so we drop and re-add.
-- NOTE: This will lock the table for a full rebuild. On large deployments with millions
-- of rows in entity_extension_time_series, plan for downtime accordingly.
ALTER TABLE entity_extension_time_series
DROP INDEX entity_extension_time_series_constraint,
DROP COLUMN `timestamp`,
ADD COLUMN `timestamp` bigint unsigned GENERATED ALWAYS AS (json_unquote(json_extract(`json`, _utf8mb4'$.timestamp'))) STORED NOT NULL,
ADD UNIQUE KEY `entity_extension_time_series_constraint` (`entityFQNHash`, `extension`, `timestamp`);