explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6FI

Settings
# exclusive inclusive rows x rows loops node
1. 0.067 6,760.205 ↑ 1.0 1 1

Aggregate (cost=60,564.29..60,564.30 rows=1 width=8) (actual time=6,760.205..6,760.205 rows=1 loops=1)

2. 5,474.062 6,760.138 ↓ 0.0 0 1

Hash Right Join (cost=40,991.75..60,560.94 rows=1,338 width=4) (actual time=6,760.138..6,760.138 rows=0 loops=1)

  • Hash Cond: (restaurant_user_rel.restaurant_user_id = restaurant_user.id)
  • Filter: (((restaurant_user.first_name)::text ~~* 'florian.barrau@maison-kayser.com.hk <florian.barrau@maison-kayser.com.hk%'::text) OR ((restaurant_user.last_name)::text ~~* 'florian.barrau@maison-kayser.com.hk <florian.barrau@maison-kayser.com.hk%'::text) OR (lower((restaurant_user.email)::text) = 'florian.barrau@maison-kayser.com.hk <florian.barrau@maison-kayser.com.hk'::text) OR ((restaurant_company.name)::text ~~* 'florian.barrau@maison-kayser.com.hk <florian.barrau@maison-kayser.com.hk%'::text) OR ((restaurant.name)::text ~~* 'florian.barrau@maison-kayser.com.hk <florian.barrau@maison-kayser.com.hk%'::text))
  • Rows Removed by Filter: 791135
3. 163.570 482.928 ↓ 1.0 193,042 1

Hash Left Join (cost=10,648.91..18,819.11 rows=193,019 width=27) (actual time=118.713..482.928 rows=193,042 loops=1)

  • Hash Cond: (restaurant_user_rel.restaurant_id = restaurant.id)
4. 201.005 201.005 ↓ 1.0 193,042 1

Seq Scan on restaurant_user_rel (cost=0.00..2,979.19 rows=193,019 width=8) (actual time=0.007..201.005 rows=193,042 loops=1)

5. 60.379 118.353 ↑ 1.0 150,393 1

Hash (cost=7,739.96..7,739.96 rows=150,396 width=27) (actual time=118.353..118.353 rows=150,393 loops=1)

  • Buckets: 8192 Batches: 32 Memory Usage: 351kB
6. 57.974 57.974 ↑ 1.0 150,393 1

Seq Scan on restaurant (cost=0.00..7,739.96 rows=150,396 width=27) (actual time=0.007..57.974 rows=150,393 loops=1)

7. 85.632 803.148 ↓ 1.0 157,596 1

Hash (cost=26,636.14..26,636.14 rows=153,016 width=66) (actual time=803.148..803.148 rows=157,596 loops=1)

  • Buckets: 8192 Batches: 64 Memory Usage: 307kB
8. 151.508 717.516 ↓ 1.0 157,596 1

Hash Right Join (cost=14,903.04..26,636.14 rows=153,016 width=66) (actual time=304.096..717.516 rows=157,596 loops=1)

  • Hash Cond: (restaurant_company_user_rel.restaurant_user_id = restaurant_user.id)
9. 134.237 462.763 ↓ 1.0 153,415 1

Hash Left Join (cost=9,974.13..16,469.26 rows=153,016 width=27) (actual time=199.309..462.763 rows=153,415 loops=1)

  • Hash Cond: (restaurant_company_user_rel.restaurant_company_id = restaurant_company.id)
10. 129.501 129.501 ↓ 1.0 153,415 1

Seq Scan on restaurant_company_user_rel (cost=0.00..2,362.16 rows=153,016 width=8) (actual time=0.004..129.501 rows=153,415 loops=1)

11. 55.501 199.025 ↓ 1.0 122,230 1

Hash (cost=7,618.28..7,618.28 rows=121,828 width=27) (actual time=199.025..199.025 rows=122,230 loops=1)

  • Buckets: 8192 Batches: 32 Memory Usage: 299kB
12. 143.524 143.524 ↓ 1.0 122,230 1

Seq Scan on restaurant_company (cost=0.00..7,618.28 rows=121,828 width=27) (actual time=0.402..143.524 rows=122,230 loops=1)

13. 57.231 103.245 ↑ 1.0 118,284 1

Hash (cost=2,410.07..2,410.07 rows=118,307 width=43) (actual time=103.245..103.245 rows=118,284 loops=1)

  • Buckets: 8192 Batches: 32 Memory Usage: 351kB
14. 46.014 46.014 ↑ 1.0 118,284 1

Seq Scan on restaurant_user (cost=0.00..2,410.07 rows=118,307 width=43) (actual time=0.518..46.014 rows=118,284 loops=1)

Planning time : 39.248 ms
Execution time : 6,760.419 ms