SELECT COUNT(*) as count, DATE_TRUNC('day', purchase_time) as day from purchase GROUP BY DATE_TRUNC('day', purchase_time) ORDER BY day DESC LIMIT 15
explain analyze SELECT COUNT(*) as count, DATE_TRUNC('day', purchase_time) as day from purchase GROUP BY DATE_TRUNC('day', purchase_time) ORDER BY day DESC LIMIT 15;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=486669.97..486673.74 rows=15 width=16) (actual time=1022.245..1121.289 rows=15 loops=1)
-> Finalize GroupAggregate (cost=486669.97..1307838.10 rows=3267753 width=16) (actual time=1015.092..1114.132 rows=15 loops=1)
Group Key: (date_trunc('day'::text, purchase_time))
-> Gather Merge (cost=486669.97..1237076.59 rows=5982920 width=16) (actual time=1012.752..1114.114 rows=46 loops=1)
Workers Planned: 2
Workers Launched: 2
-> Partial GroupAggregate (cost=485669.94..545499.14 rows=2991460 width=16) (actual time=729.113..927.120 rows=1097 loops=3)
Group Key: (date_trunc('day'::text, purchase_time))
-> Sort (cost=485669.94..493148.59 rows=2991460 width=8) (actual time=728.790..844.880 rows=1766009 loops=3)
Sort Key: (date_trunc('day'::text, purchase_time)) DESC
Sort Method: external merge Disk: 29496kB
Worker 0: Sort Method: external merge Disk: 28584kB
Worker 1: Sort Method: external merge Disk: 28544kB
-> Parallel Seq Scan on purchase (cost=0.00..123001.25 rows=2991460 width=8) (actual time=3.744..551.538 rows=2454637 loops=3)
Planning Time: 0.572 ms
JIT:
Functions: 22
Options: Inlining false, Optimization false, Expressions true, Deforming true
Timing: Generation 3.093 ms, Inlining 0.000 ms, Optimization 0.951 ms, Emission 16.912 ms, Total 20.956 ms
Execution Time: 1157.467 ms
(20 rows)
s\/‘//
$ echo abc | sed sßbßbbß
sed: -e expression #1, char 2: delimiter character is not a single-byte character
s\/‘//
npm build