Files
threshold/internal/db/sqltest/tests/pagination/host.sql
T
Johan Brandhorst-Satzkorn b229ece914 internal/db: use more efficient index for host listing (#4256)
In tests, the index including the catalog_id performs significantly
better.
2024-01-19 10:59:18 -08:00

16 lines
700 B
PL/PgSQL

-- Copyright (c) HashiCorp, Inc.
-- SPDX-License-Identifier: BUSL-1.1
begin;
select plan(4);
select has_index('host_plugin_host', 'host_plugin_host_catalog_id_create_time_public_id_idx', array['catalog_id', 'create_time', 'public_id']);
select has_index('host_plugin_host', 'host_plugin_host_catalog_id_update_time_public_id_idx', array['catalog_id', 'update_time', 'public_id']);
select has_index('static_host', 'static_host_catalog_id_create_time_public_id_idx', array['catalog_id', 'create_time', 'public_id']);
select has_index('static_host', 'static_host_catalog_id_update_time_public_id_idx', array['catalog_id', 'update_time', 'public_id']);
select * from finish();
rollback;