By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| version |
|---|
| PostgreSQL 12.12 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 170
CREATE TABLE
CREATE INDEX
CREATE TABLE
INSERT 0 170
CREATE INDEX
CLUSTER
CREATE FUNCTION
CREATE TRIGGER
CREATE FUNCTION
CREATE TRIGGER
| QUERY PLAN |
|---|
| Insert on public.store_record (cost=0.00..42.50 rows=1000 width=20) (actual time=82.952..82.953 rows=0 loops=1) |
| -> Subquery Scan on "*SELECT*" (cost=0.00..42.50 rows=1000 width=20) (actual time=1.813..18.630 rows=10001 loops=1) |
| Output: nextval('store_record_id_seq'::regclass), "*SELECT*"."?column?_1", "*SELECT*"."?column?" |
| -> Function Scan on pg_catalog.generate_series a (cost=0.00..25.00 rows=1000 width=16) (actual time=1.775..6.875 rows=10001 loops=1) |
| Output: (random() * '100'::double precision), (now() + (random() * '00:00:01'::interval)) |
| Function Call: generate_series('0'::numeric, '10000'::numeric, '1'::numeric) |
| Planning Time: 0.068 ms |
| Trigger RI_ConstraintTrigger_c_1162088 for constraint store_record_database_id_fkey: time=122.849 calls=10001 |
| Execution Time: 207.669 ms |
EXPLAIN
| database_id | latest_record_updated_at | record_count |
|---|---|---|
| 26 | 2022-11-11 18:25:31.994843+00 | 129 |
| 66 | 2022-11-11 18:25:32.007389+00 | 123 |
| 35 | 2022-11-11 18:25:32.004359+00 | 122 |
| 48 | 2022-11-11 18:25:32.007632+00 | 120 |
| 50 | 2022-11-11 18:25:32.000157+00 | 119 |
| 12 | 2022-11-11 18:25:32.004489+00 | 118 |
| 32 | 2022-11-11 18:25:31.984583+00 | 118 |
| 10 | 2022-11-11 18:25:32.005893+00 | 117 |
| 44 | 2022-11-11 18:25:32.007527+00 | 116 |
| 15 | 2022-11-11 18:25:31.994287+00 | 115 |
SELECT 10