By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
CREATE TABLE
INSERT 0 4
id | date | issuer | index_code | opening_closing |
---|---|---|---|---|
1393 | 2024-04-25 | cboe | buk350n | O |
1394 | 2024-04-25 | cboe | buk350n | O |
1395 | 2024-03-25 | cboe | buk350n | O |
1402 | 2024-04-24 | cboe | buk350n | O |
SELECT 4
max |
---|
2024-04-25 |
SELECT 1
table_catalog | table_schema | table_name | column_name | ordinal_position | column_default | is_nullable | data_type | character_maximum_length | character_octet_length | numeric_precision | numeric_precision_radix | numeric_scale | datetime_precision | interval_type | interval_precision | character_set_catalog | character_set_schema | character_set_name | collation_catalog | collation_schema | collation_name | domain_catalog | domain_schema | domain_name | udt_catalog | udt_schema | udt_name | scope_catalog | scope_schema | scope_name | maximum_cardinality | dtd_identifier | is_self_referencing | is_identity | identity_generation | identity_start | identity_increment | identity_maximum | identity_minimum | identity_cycle | is_generated | generation_expression | is_updatable |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
postgres | public | index_constituents | id | 1 | null | YES | integer | null | null | 32 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | postgres | pg_catalog | int4 | null | null | null | null | 1 | NO | NO | null | null | null | null | null | NO | NEVER | null | YES |
postgres | public | index_constituents | date | 2 | null | YES | date | null | null | null | null | null | 0 | null | null | null | null | null | null | null | null | null | null | null | postgres | pg_catalog | date | null | null | null | null | 2 | NO | NO | null | null | null | null | null | NO | NEVER | null | YES |
postgres | public | index_constituents | issuer | 3 | null | YES | character varying | 10 | 40 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null | postgres | pg_catalog | varchar | null | null | null | null | 3 | NO | NO | null | null | null | null | null | NO | NEVER | null | YES |
postgres | public | index_constituents | index_code | 4 | null | YES | character varying | 255 | 1020 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null | postgres | pg_catalog | varchar | null | null | null | null | 4 | NO | NO | null | null | null | null | null | NO | NEVER | null | YES |
postgres | public | index_constituents | opening_closing | 5 | null | YES | character varying | 20 | 80 | null | null | null | null | null | null | null | null | null | null | null | null | null | null | null | postgres | pg_catalog | varchar | null | null | null | null | 5 | NO | NO | null | null | null | null | null | NO | NEVER | null | YES |
SELECT 5