add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
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?.
version
PostgreSQL 14.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10), 64-bit
SELECT 1
CREATE TABLE
INSERT 0 5
CREATE TABLE
INSERT 0 11
user_id session_id timestamp
8 652 2016-04-01 00:46:11.638
8 652 2016-04-01 00:47:00.566
8 652 2016-04-01 00:48:06.383
9 656 2016-04-01 00:14:17.707
9 656 2016-04-01 00:15:18.664
9 656 2016-04-01 00:16:19.687
9 656 2016-04-01 00:24:20.691
9 656 2016-04-01 00:25:23.681
9 657 2016-04-01 00:24:50.842
9 657 2016-04-01 00:26:51.096
9 657 2016-04-01 00:37:54.092
SELECT 11
user_id session_id start_time mode
48 652 2016-04-01 00:47:00 foot
9 656 2016-04-01 00:03:39 car
9 657 2016-04-01 00:26:51 car
9 658 2016-04-01 00:45:19 car
46 663 2016-04-01 00:13:12 car
SELECT 5
session_id timestamp user_id start_time number_of_sessions_with_problem
656 2016-04-01 00:16:19.687 9 2016-04-01 00:03:39 2
657 2016-04-01 00:26:51.096 9 2016-04-01 00:26:51 2
SELECT 2