explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uwgI

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 21,065.763 ↓ 5.0 5 1

Unique (cost=32,499,482.30..32,499,482.30 rows=1 width=150) (actual time=21,065.756..21,065.763 rows=5 loops=1)

2. 0.082 21,065.756 ↓ 8.0 8 1

Sort (cost=32,499,482.30..32,499,482.30 rows=1 width=150) (actual time=21,065.756..21,065.756 rows=8 loops=1)

  • Sort Key: x.content
  • Sort Method: quicksort Memory: 28kB
3. 0.003 21,065.674 ↓ 8.0 8 1

Subquery Scan on x (cost=32,499,482.27..32,499,482.29 rows=1 width=150) (actual time=21,065.672..21,065.674 rows=8 loops=1)

4. 0.030 21,065.671 ↓ 8.0 8 1

Sort (cost=32,499,482.27..32,499,482.28 rows=1 width=154) (actual time=21,065.671..21,065.671 rows=8 loops=1)

  • Sort Key: a.followers_count DESC
  • Sort Method: quicksort Memory: 28kB
5. 0.052 21,065.641 ↓ 8.0 8 1

Nested Loop (cost=169,284.24..32,499,482.26 rows=1 width=154) (actual time=13,329.451..21,065.641 rows=8 loops=1)

6. 25.722 21,064.925 ↓ 8.0 8 1

Nested Loop (cost=169,283.81..32,499,473.85 rows=1 width=158) (actual time=13,329.363..21,064.925 rows=8 loops=1)

7. 58.710 11,156.935 ↓ 43.2 31,273 1

HashAggregate (cost=169,283.25..169,290.49 rows=724 width=19) (actual time=11,137.362..11,156.935 rows=31,273 loops=1)

  • Group Key: (tweet_mentions.tweet_id)::text
8. 298.527 11,098.225 ↓ 43.3 31,319 1

Gather (cost=1,006.17..169,281.44 rows=724 width=19) (actual time=3.180..11,098.225 rows=31,319 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
9. 28.372 10,799.698 ↓ 34.6 10,440 3 / 3

Nested Loop (cost=6.17..168,209.04 rows=302 width=19) (actual time=9.565..10,799.698 rows=10,440 loops=3)

10. 10,405.012 10,405.012 ↓ 5.8 836 3 / 3

Parallel Seq Scan on accounts (cost=0.00..89,407.24 rows=145 width=8) (actual time=8.159..10,405.012 rows=836 loops=3)

  • Filter: (lower(description) ~~ '%comedian%'::text)
  • Rows Removed by Filter: 1,154,216
11. 307.771 366.314 ↑ 18.9 12 2,509 / 3

Bitmap Heap Scan on tweet_mentions (cost=6.17..541.19 rows=227 width=27) (actual time=0.088..0.438 rows=12 loops=2,509)

  • Recheck Cond: (account_id = accounts.id)
  • Heap Blocks: exact=7,094
12. 58.543 58.543 ↑ 18.9 12 2,509 / 3

Bitmap Index Scan on tweet_mentions_account_id_dd094f3d (cost=0.00..6.11 rows=227 width=0) (actual time=0.070..0.070 rows=12 loops=2,509)

  • Index Cond: (account_id = accounts.id)
13. 4,922.116 9,882.268 ↓ 0.0 0 31,273

Index Scan using tweets_id_8b9bf972_like on tweets t (cost=0.56..44,593.36 rows=1 width=178) (actual time=0.316..0.316 rows=0 loops=31,273)

  • Index Cond: ((id)::text = (tweet_mentions.tweet_id)::text)
  • Filter: ((lower(content) ~~ '%conspiracy%'::text) AND ((retweet_count <= 10) OR (retweet_count > 50)) AND (NOT (SubPlan 1)))
  • Rows Removed by Filter: 1
14.          

SubPlan (for Index Scan)

15. 4,238.246 4,960.152 ↑ 1.1 2,748,901 9

Materialize (cost=0.00..81,924.69 rows=2,903,846 width=20) (actual time=0.044..551.128 rows=2,748,901 loops=9)

16. 721.906 721.906 ↓ 1.0 2,903,860 1

Seq Scan on tweet_hashtags (cost=0.00..50,390.46 rows=2,903,846 width=20) (actual time=0.186..721.906 rows=2,903,860 loops=1)

17. 0.664 0.664 ↑ 1.0 1 8

Index Scan using accounts_pkey on accounts a (cost=0.43..8.41 rows=1 width=12) (actual time=0.083..0.083 rows=1 loops=8)

  • Index Cond: (id = t.author_id)
Planning time : 1.948 ms