BEGIN;
-- single fixed-size column (offset fully cacheable)
CREATE UNIQUE INDEX uidx ON index_test USING btree (transaction);
INSERT INTO index_test SELECT * FROM land_registry_price_paid_uk;
REINDEX INDEX uidx;
DROP INDEX uidx;
TRUNCATE index_test;

-- var-len prefix column (no offset cache after 1st column)
CREATE INDEX ccl ON index_test USING btree (county, city, locality);
INSERT INTO index_test SELECT * FROM land_registry_price_paid_uk;
REINDEX INDEX ccl;
DROP INDEX ccl;
TRUNCATE index_test;

-- var-len prefix column with (expensive) collation, no cache after 1st column
CREATE INDEX ccl_collated ON index_test USING btree (county COLLATE "en_US", city, locality);
INSERT INTO index_test SELECT * FROM land_registry_price_paid_uk;
REINDEX INDEX ccl_collated;
DROP INDEX ccl_collated;
TRUNCATE index_test;

-- null prefix column (no cache used for all columns)
CREATE INDEX accl ON index_test USING btree (always_null, county, city, locality);
INSERT INTO index_test SELECT * FROM land_registry_price_paid_uk;
REINDEX INDEX accl;
DROP INDEX accl;
TRUNCATE index_test;

-- fixed-width columns (all offsets cached)
CREATE INDEX tnt ON index_test USING btree (transfer_date, newly_built, transaction);
INSERT INTO index_test SELECT * FROM land_registry_price_paid_uk;
REINDEX INDEX tnt;
DROP INDEX tnt;
TRUNCATE index_test;
COMMIT;