explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cdcj

Settings
# exclusive inclusive rows x rows loops node
1. 0.056 2,887.003 ↑ 512.8 78 1

Sort (cost=268,357.26..268,457.26 rows=40,000 width=52) (actual time=2,886.998..2,887.003 rows=78 loops=1)

  • Sort Key: (count(orders_2019_04_12.order_id)) DESC
  • Sort Method: quicksort Memory: 31kB
2.          

CTE os

3. 0.004 1,280.893 ↑ 1.0 15 1

Limit (cost=125,590.08..125,590.11 rows=15 width=12) (actual time=1,280.889..1,280.893 rows=15 loops=1)

4. 0.058 1,280.889 ↑ 13.3 15 1

Sort (cost=125,590.08..125,590.58 rows=200 width=12) (actual time=1,280.888..1,280.889 rows=15 loops=1)

  • Sort Key: (count(orders_2019_04_12_1.order_id)) DESC
  • Sort Method: top-N heapsort Memory: 26kB
5. 253.768 1,280.831 ↓ 1.8 361 1

HashAggregate (cost=125,583.17..125,585.17 rows=200 width=12) (actual time=1,280.780..1,280.831 rows=361 loops=1)

  • Group Key: orders_2019_04_12_1.app_id
6. 130.610 1,027.063 ↑ 1.0 1,847,209 1

Append (cost=0.14..116,339.26 rows=1,848,783 width=20) (actual time=0.002..1,027.063 rows=1,847,209 loops=1)

  • Subplans Removed: 31
7. 896.453 896.453 ↑ 1.0 1,847,209 1

Seq Scan on orders_2019_04_12 orders_2019_04_12_1 (cost=0.00..106,834.92 rows=1,848,752 width=20) (actual time=0.002..896.453 rows=1,847,209 loops=1)

  • Filter: ((order_timestamp <= now()) AND (order_timestamp >= (CURRENT_DATE)::timestamp without time zone))
8. 360.338 2,886.947 ↑ 512.8 78 1

HashAggregate (cost=138,409.60..139,709.60 rows=40,000 width=52) (actual time=2,886.721..2,886.947 rows=78 loops=1)

  • Group Key: orders_2019_04_12.app_id, orders_2019_04_12.status
9. 300.497 2,526.609 ↓ 2.0 1,835,646 1

Hash Semi Join (cost=0.63..131,476.66 rows=924,392 width=28) (actual time=1,280.932..2,526.609 rows=1,835,646 loops=1)

  • Hash Cond: (orders_2019_04_12.app_id = os.app_id)
10. 130.429 945.203 ↑ 1.0 1,847,209 1

Append (cost=0.14..116,339.26 rows=1,848,783 width=28) (actual time=0.007..945.203 rows=1,847,209 loops=1)

  • Subplans Removed: 31
11. 814.774 814.774 ↑ 1.0 1,847,209 1

Seq Scan on orders_2019_04_12 (cost=0.00..106,834.92 rows=1,848,752 width=28) (actual time=0.007..814.774 rows=1,847,209 loops=1)

  • Filter: ((order_timestamp <= now()) AND (order_timestamp >= (CURRENT_DATE)::timestamp without time zone))
12. 0.009 1,280.909 ↑ 1.0 15 1

Hash (cost=0.30..0.30 rows=15 width=4) (actual time=1,280.909..1,280.909 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 1,280.900 1,280.900 ↑ 1.0 15 1

CTE Scan on os (cost=0.00..0.30 rows=15 width=4) (actual time=1,280.892..1,280.900 rows=15 loops=1)