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
CREATE TABLE
CREATE TABLE
INSERT 0 3
INSERT 0 3
INSERT 0 4
user_id | user_name | ad_id | ad_owner_id | last_message_content | last_message_created_at | unread_messages_count |
---|---|---|---|---|---|---|
80d1c6070a7d | User1 | ad3 | someuuid3 | Fine, thank you | 2023-11-27 12:00:00 | 1 |
80d1c6070a7d | User1 | ad2 | someuuid2 | How are you? | 2023-11-27 11:00:00 | 1 |
80d1c6070a7d | User1 | ad1 | 80d1c6070a7d | Hi | 2023-11-27 10:02:00 | 1 |
80d1c6070a7d | User1 | ad1 | 80d1c6070a7d | Hello | 2023-11-27 10:00:00 | 0 |
SELECT 4