explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sHPu

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 34,234.543 ↑ 2.5 4 1

Limit (cost=1,296,191.26..1,296,191.28 rows=10 width=40) (actual time=34,234.543..34,234.543 rows=4 loops=1)

2. 0.007 34,234.542 ↑ 50.0 4 1

Sort (cost=1,296,191.26..1,296,191.76 rows=200 width=40) (actual time=34,234.542..34,234.542 rows=4 loops=1)

  • Sort Key: (count(1)) DESC
  • Sort Method: quicksort Memory: 25kB
3. 0.011 34,234.535 ↑ 50.0 4 1

GroupAggregate (cost=1,295,884.94..1,296,186.94 rows=200 width=40) (actual time=34,234.533..34,234.535 rows=4 loops=1)

  • Group Key: q2.hashtag_name
4. 0.015 34,234.524 ↑ 10,000.0 4 1

Sort (cost=1,295,884.94..1,295,984.94 rows=40,000 width=32) (actual time=34,234.524..34,234.524 rows=4 loops=1)

  • Sort Key: q2.hashtag_name
  • Sort Method: quicksort Memory: 25kB
5. 0.003 34,234.509 ↑ 10,000.0 4 1

Subquery Scan on q2 (cost=1,252,270.53..1,292,827.39 rows=40,000 width=32) (actual time=34,234.499..34,234.509 rows=4 loops=1)

6. 0.009 34,234.506 ↑ 10,000.0 4 1

Unique (cost=1,252,270.53..1,292,427.39 rows=40,000 width=40) (actual time=34,234.497..34,234.506 rows=4 loops=1)

7. 0.049 34,234.497 ↑ 83,660.1 64 1

Sort (cost=1,252,270.53..1,265,656.15 rows=5,354,249 width=40) (actual time=34,234.496..34,234.497 rows=64 loops=1)

  • Sort Key: q.id, ((q.te ->> 'hashtagName'::text))
  • Sort Method: quicksort Memory: 29kB
8. 13.422 34,234.448 ↑ 83,660.1 64 1

Merge Join (cost=226,013.82..361,055.89 rows=5,354,249 width=40) (actual time=34,234.429..34,234.448 rows=64 loops=1)

  • Merge Cond: ((((tiktok.json ->> 'id'::text))::bigint) = q.id)
9. 0.012 0.411 ↑ 578.5 4 1

Sort (cost=5,763.53..5,769.32 rows=2,314 width=126) (actual time=0.410..0.411 rows=4 loops=1)

  • Sort Key: (((tiktok.json ->> 'id'::text))::bigint)
  • Sort Method: quicksort Memory: 25kB
10. 0.273 0.399 ↑ 578.5 4 1

Bitmap Heap Scan on tiktok (cost=54.36..5,634.22 rows=2,314 width=126) (actual time=0.262..0.399 rows=4 loops=1)

  • Recheck Cond: (((json -> 'author'::text) ->> 'uniqueId'::text) = 'lilweehag'::text)
  • Heap Blocks: exact=3
11. 0.126 0.126 ↑ 578.5 4 1

Bitmap Index Scan on tiktok_author (cost=0.00..53.78 rows=2,314 width=0) (actual time=0.126..0.126 rows=4 loops=1)

  • Index Cond: (((json -> 'author'::text) ->> 'uniqueId'::text) = 'lilweehag'::text)
12. 19.662 34,220.615 ↑ 2.3 202,444 1

Materialize (cost=220,250.28..222,564.13 rows=462,770 width=40) (actual time=34,154.995..34,220.615 rows=202,444 loops=1)

13. 12,269.420 34,200.953 ↑ 2.3 202,396 1

Sort (cost=220,250.28..221,407.21 rows=462,770 width=40) (actual time=34,154.981..34,200.953 rows=202,396 loops=1)

  • Sort Key: q.id
  • Sort Method: external merge Disk: 489,896kB
14. 448.413 21,931.533 ↓ 5.0 2,324,191 1

Subquery Scan on q (cost=1,000.00..164,047.78 rows=462,770 width=40) (actual time=1.657..21,931.533 rows=2,324,191 loops=1)

15. 0.000 21,483.120 ↓ 5.0 2,324,191 1

Gather (cost=1,000.00..159,420.08 rows=462,770 width=40) (actual time=1.655..21,483.120 rows=2,324,191 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
16. 22,767.339 22,887.079 ↑ 24.9 774,730 3 / 3

ProjectSet (cost=0.00..112,143.08 rows=19,282,100 width=40) (actual time=2.665..22,887.079 rows=774,730 loops=3)

17. 119.740 119.740 ↑ 1.2 154,273 3 / 3

Parallel Seq Scan on tiktok tiktok_1 (cost=0.00..12,358.21 rows=192,821 width=118) (actual time=0.604..119.740 rows=154,273 loops=3)