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?.
DROP TABLE
CREATE TABLE
INSERT 0 1
j |
---|
[{"name": "vehicle.moving", "token": "a978f9793a594d11860e9cf7962996d7", "description": "Vehicle is moving."}, {"name": "vehicle.stopped", "token": "95e38bf08c2842f39f2d64ba8152b265", "description": "Vehicle, with a driver/rider in/on it, is currently stationary but has an intent to move."}] |
SELECT 1
jsonb_array_elements |
---|
{"name": "vehicle.moving", "token": "a978f9793a594d11860e9cf7962996d7", "description": "Vehicle is moving."} |
{"name": "vehicle.stopped", "token": "95e38bf08c2842f39f2d64ba8152b265", "description": "Vehicle, with a driver/rider in/on it, is currently stationary but has an intent to move."} |
SELECT 2
token | name | description |
---|---|---|
a978f9793a594d11860e9cf7962996d7 | vehicle.moving | Vehicle is moving. |
95e38bf08c2842f39f2d64ba8152b265 | vehicle.stopped | Vehicle, with a driver/rider in/on it, is currently stationary but has an intent to move. |
SELECT 2
token | name | description |
---|---|---|
a978f9793a594d11860e9cf7962996d7 | vehicle.moving | Vehicle is moving. |
95e38bf08c2842f39f2d64ba8152b265 | vehicle.stopped | Vehicle, with a driver/rider in/on it, is currently stationary but has an intent to move. |
SELECT 2
CREATE TABLE
INSERT 0 2
token | name | description |
---|---|---|
a978f9793a594d11860e9cf7962996d7 | vehicle.moving | Vehicle is moving. |
95e38bf08c2842f39f2d64ba8152b265 | vehicle.stopped | Vehicle, with a driver/rider in/on it, is currently stationary but has an intent to move. |
SELECT 2