explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cOVF

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 3,780.977 ↓ 0.0 0 1

Limit (cost=1,165,072.79..1,165,072.84 rows=20 width=666) (actual time=3,780.977..3,780.977 rows=0 loops=1)

  • Buffers: shared hit=88,226 read=1,003,835 dirtied=5, temp read=1,321 written=1,315
2. 0.010 3,780.977 ↓ 0.0 0 1

Sort (cost=1,165,072.54..1,165,073.31 rows=308 width=666) (actual time=3,780.976..3,780.977 rows=0 loops=1)

  • Sort Key: (unaccent(("Chip".serial)::text))
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=88,226 read=1,003,835 dirtied=5, temp read=1,321 written=1,315
3. 0.000 3,780.967 ↓ 0.0 0 1

Nested Loop Left Join (cost=67,835.35..1,165,060.37 rows=308 width=666) (actual time=3,780.967..3,780.967 rows=0 loops=1)

  • Buffers: shared hit=88,226 read=1,003,835 dirtied=5, temp read=1,321 written=1,315
4. 0.002 3,780.968 ↓ 0.0 0 1

Nested Loop Left Join (cost=67,835.07..1,164,964.86 rows=308 width=567) (actual time=3,780.967..3,780.968 rows=0 loops=1)

  • Buffers: shared hit=88,226 read=1,003,835 dirtied=5, temp read=1,321 written=1,315
5. 192.071 3,780.966 ↓ 0.0 0 1

Hash Left Join (cost=67,834.79..1,164,868.82 rows=308 width=333) (actual time=3,780.966..3,780.966 rows=0 loops=1)

  • Hash Cond: ("Chip".enterprise_id = enterprise.id)
  • Filter: ((unaccent(("Chip".number)::text) ~* unaccent('test'::text)) OR (unaccent(("Chip".serial)::text) ~* unaccent('test'::text)) OR (unaccent(("Chip".carrier)::text) ~* unaccent('test'::text)) OR (unaccent((enterprise.name)::text) ~* unaccent('test'::text)))
  • Rows Removed by Filter: 32,473
  • Buffers: shared hit=88,226 read=1,003,835 dirtied=5, temp read=1,321 written=1,315
6. 88.463 3,588.020 ↑ 1.5 32,473 1

Hash Right Join (cost=67,704.64..1,162,819.17 rows=48,240 width=266) (actual time=172.794..3,588.020 rows=32,473 loops=1)

  • Hash Cond: (device.chip_id = "Chip".id)
  • Buffers: shared hit=88,113 read=1,003,835 dirtied=5, temp read=1,321 written=1,315
7. 3,326.905 3,326.905 ↓ 1.0 74,236 1

Seq Scan on devices device (cost=0.00..1,091,004.41 rows=73,505 width=103) (actual time=0.063..3,326.905 rows=74,236 loops=1)

  • Filter: ((deleted_at > '2020-08-01 00:00:00+00'::timestamp with time zone) OR (deleted_at IS NULL))
  • Rows Removed by Filter: 4,526
  • Buffers: shared hit=86,202 read=1,003,835 dirtied=5
8. 23.037 172.652 ↑ 1.5 32,473 1

Hash (cost=65,970.64..65,970.64 rows=48,240 width=163) (actual time=172.652..172.652 rows=32,473 loops=1)

  • Buckets: 32,768 Batches: 4 Memory Usage: 1,641kB
  • Buffers: shared hit=1,911, temp written=477
9. 149.615 149.615 ↑ 1.5 32,473 1

Seq Scan on chips "Chip" (cost=0.00..65,970.64 rows=48,240 width=163) (actual time=0.012..149.615 rows=32,473 loops=1)

  • Filter: ((archived_at IS NULL) AND ((deleted_at > '2020-08-01 00:00:00+00'::timestamp with time zone) OR (deleted_at IS NULL)) AND ((enterprise_id = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299}'::integer[])) OR (owner_enterprise_id = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299}'::integer[]))))
  • Rows Removed by Filter: 49,280
  • Buffers: shared hit=1,911
10. 0.316 0.875 ↓ 1.0 678 1

Hash (cost=121.74..121.74 rows=673 width=67) (actual time=0.875..0.875 rows=678 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 69kB
  • Buffers: shared hit=113
11. 0.559 0.559 ↓ 1.0 678 1

Seq Scan on enterprises enterprise (cost=0.00..121.74 rows=673 width=67) (actual time=0.017..0.559 rows=678 loops=1)

  • Filter: ((deleted_at > '2020-08-01 00:00:00+00'::timestamp with time zone) OR (deleted_at IS NULL))
  • Rows Removed by Filter: 26
  • Buffers: shared hit=113
12. 0.000 0.000 ↓ 0.0 0

Index Scan using tickets_pkey on tickets ticket (cost=0.28..0.30 rows=1 width=234) (never executed)

  • Index Cond: ("Chip".ticket_id = id)
  • Filter: ((deleted_at > '2020-08-01 00:00:00+00'::timestamp with time zone) OR (deleted_at IS NULL))
13. 0.000 0.000 ↓ 0.0 0

Index Scan using enterprises_pkey on enterprises owner_enterprise (cost=0.28..0.30 rows=1 width=67) (never executed)

  • Index Cond: ("Chip".owner_enterprise_id = id)
  • Filter: ((deleted_at > '2020-08-01 00:00:00+00'::timestamp with time zone) OR (deleted_at IS NULL))
Planning time : 1.820 ms
Execution time : 3,781.768 ms