diff --git a/tsl/test/expected/hypercore_index_btree.out b/tsl/test/expected/hypercore_index_btree.out index ee6fbd72f..892531327 100644 --- a/tsl/test/expected/hypercore_index_btree.out +++ b/tsl/test/expected/hypercore_index_btree.out @@ -258,6 +258,10 @@ and (attname='location_id' or attname='device_id' or attname='owner_id'); -- the query should not use index-only scan on the hypestore chunk -- (number 2) because it is not supported on segmentby indexes +-- +-- first, drop one of the indexes on location_id to make the index to +-- pick predictible +drop index hypertable_location_id_include_humidity_idx; select explain_anonymize(format($$ select location_id, count(*) into comp from %s where location_id in (3,4,5) group by location_id @@ -646,6 +650,8 @@ $$, :'chunk1')); -- Analyze will run the queries so we are satisfied with this right -- now and do not run the queries separately since they can generate -- different results depending on table contents. +-- Add back covering index on location_id +create index hypertable_location_id_include_humidity_idx on :hypertable (location_id) include (humidity); select explain_analyze_anonymize(format($$ select location_id, avg(humidity) from %s where location_id between 5 and 10 group by location_id order by location_id diff --git a/tsl/test/sql/hypercore_index_btree.sql b/tsl/test/sql/hypercore_index_btree.sql index a606374b0..daf79eafc 100644 --- a/tsl/test/sql/hypercore_index_btree.sql +++ b/tsl/test/sql/hypercore_index_btree.sql @@ -93,6 +93,10 @@ and (attname='location_id' or attname='device_id' or attname='owner_id'); -- the query should not use index-only scan on the hypestore chunk -- (number 2) because it is not supported on segmentby indexes +-- +-- first, drop one of the indexes on location_id to make the index to +-- pick predictible +drop index hypertable_location_id_include_humidity_idx; select explain_anonymize(format($$ select location_id, count(*) into comp from %s where location_id in (3,4,5) group by location_id @@ -213,6 +217,10 @@ $$, :'chunk1')); -- Analyze will run the queries so we are satisfied with this right -- now and do not run the queries separately since they can generate -- different results depending on table contents. + +-- Add back covering index on location_id +create index hypertable_location_id_include_humidity_idx on :hypertable (location_id) include (humidity); + select explain_analyze_anonymize(format($$ select location_id, avg(humidity) from %s where location_id between 5 and 10 group by location_id order by location_id