explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OgTQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.852 50,509.079 ↑ 85.0 1,080 1

Unique (cost=2,310,625,150.60..2,310,629,742.00 rows=91,828 width=383) (actual time=50,508.104..50,509.079 rows=1,080 loops=1)

2. 15.990 50,508.227 ↑ 85.0 1,080 1

Sort (cost=2,310,625,150.60..2,310,625,380.17 rows=91,828 width=383) (actual time=50,508.102..50,508.227 rows=1,080 loops=1)

  • Sort Key: esercenti.username, esercenti.name, ((SubPlan 1)), ((SubPlan 2)), (CASE WHEN (((SubPlan 3))::text ~~ '%B2C%'::text) THEN 'YES'::text ELSE 'NO'::text END), ((SubPlan 5)), (COALESCE((SubPlan 7), '0'::numeric)), (COALESCE((SubPlan 9), '0'::numeric)), (trunc(COALESCE((SubPlan 11), '0'::numeric), 2)), (trunc((((COALESCE((SubPlan 13), '0'::numeric))::double precision / COALESCE(NULLIF((((date_part('year'::text, now()) - date_part('year'::text, COALESCE(((SubPlan 15))::timestamp with time zone, now()))) * '12'::double precision) + (date_part('month'::text, now()) - date_part('month'::text, COALESCE(((SubPlan 17))::timestamp with time zone, now())))), '0'::double precision), '1'::double precision)))::numeric, 2)), (trunc((((COALESCE((SubPlan 19), '0'::numeric))::double precision / COALESCE(NULLIF((((date_part('year'::text, now()) - date_part('year'::text, COALESCE(((SubPlan 21))::timestamp with time zone, now()))) * '12'::double precision) + (date_part('month'::text, now()) - date_part('month'::text, COALESCE(((SubPlan 23))::timestamp with time zone, now())))), '0'::double precision), '1'::double precision)))::numeric, 2)), (COALESCE((SubPlan 25), '0'::numeric)), ((SubPlan 27)), ((SubPlan 28)), (COALESCE((SubPlan 30), '0'::numeric)), (COALESCE((SubPlan 32), '0'::numeric)), ((SubPlan 33)), ((SubPlan 34)), ((SubPlan 37))
  • Sort Method: quicksort Memory: 335kB
3. 421.433 50,492.237 ↑ 85.0 1,080 1

Seq Scan on users esercenti (cost=0.00..2,310,601,571.92 rows=91,828 width=383) (actual time=73.051..50,492.237 rows=1,080 loops=1)

  • Filter: ((SubPlan 38) > 0)
  • Rows Removed by Filter: 274404
4.          

SubPlan (for Seq Scan)

5. 5.400 43.200 ↑ 1.0 1 1,080

Limit (cost=18.93..18.93 rows=1 width=16) (actual time=0.038..0.040 rows=1 loops=1,080)

6. 9.720 37.800 ↑ 1.0 1 1,080

Sort (cost=18.93..18.93 rows=1 width=16) (actual time=0.035..0.035 rows=1 loops=1,080)

  • Sort Key: user_group_logs.id
  • Sort Method: quicksort Memory: 25kB
7. 4.941 28.080 ↓ 2.0 2 1,080

Nested Loop (cost=0.57..18.91 rows=1 width=16) (actual time=0.020..0.026 rows=2 loops=1,080)

8. 8.640 8.640 ↓ 4.0 4 1,080

Index Scan using ix_user_group_logs_fk_user_group_logs_user_id on user_group_logs (cost=0.42..8.44 rows=1 width=24) (actual time=0.005..0.008 rows=4 loops=1,080)

  • Index Cond: (esercenti.id = user_id)
9. 14.499 14.499 ↓ 0.0 0 4,833

Index Scan using groups_pkey on groups (cost=0.15..8.18 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=4,833)

  • Index Cond: (id = user_group_logs.group_id)
  • Filter: (((name)::text = 'SRD.B2B.B2E.B2C'::text) OR ((name)::text = 'SRD.B2B.B2E.B2C.Shadow'::text) OR ((name)::text = 'SRD.B2B.B2E.B2C.Solo.Ricarica.Shadow'::text) OR ((name)::text = 'SRD.B2B.B2E.B2C.SoloAccettazione'::text) OR ((name)::text = 'SRD.B2B.B2E.B2C.SoloAccettazione.Shadow'::text) OR ((name)::text = 'SRD.B2B.B2E.B2C.SoloRicarica'::text))
  • Rows Removed by Filter: 1
10. 2.160 51.840 ↓ 0.0 0 1,080

Limit (cost=14.18..14.19 rows=1 width=16) (actual time=0.048..0.048 rows=0 loops=1,080)

11. 9.720 49.680 ↓ 0.0 0 1,080

Sort (cost=14.18..14.19 rows=1 width=16) (actual time=0.046..0.046 rows=0 loops=1,080)

  • Sort Key: users_products_logs.id DESC
  • Sort Method: quicksort Memory: 25kB
12. 4.320 39.960 ↓ 0.0 0 1,080

Bitmap Heap Scan on users_products_logs (cost=10.15..14.17 rows=1 width=16) (actual time=0.037..0.037 rows=0 loops=1,080)

  • Recheck Cond: ((user_id = esercenti.id) AND (product_id = 562))
  • Filter: ((action)::text = 'ASSIGN'::text)
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=156
13. 2.561 35.640 ↓ 0.0 0 1,080

BitmapAnd (cost=10.15..10.15 rows=1 width=0) (actual time=0.033..0.033 rows=0 loops=1,080)

14. 11.880 11.880 ↑ 1.0 5 1,080

Bitmap Index Scan on ix_users_products_logs_fk_users_products_logs_user_id (cost=0.00..4.32 rows=5 width=0) (actual time=0.011..0.011 rows=5 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
15. 21.199 21.199 ↑ 1.0 172 731

Bitmap Index Scan on ix_users_products_logs_fk_users_products_logs_product_id (cost=0.00..5.58 rows=172 width=0) (actual time=0.029..0.029 rows=172 loops=731)

  • Index Cond: (product_id = 562)
16. 4.320 4.320 ↑ 1.0 1 1,080

Index Scan using groups_pkey on groups groups_1 (cost=0.15..8.17 rows=1 width=22) (actual time=0.003..0.004 rows=1 loops=1,080)

  • Index Cond: (id = esercenti.user_group_id)
17. 0.000 548.640 ↑ 1.0 1 1,080

Aggregate (cost=52.10..52.11 rows=1 width=8) (actual time=0.508..0.508 rows=1 loops=1,080)

18.          

Initplan (for Aggregate)

19. 27.000 27.000 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts (cost=0.42..9.34 rows=1 width=8) (actual time=0.018..0.025 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 10)
  • Rows Removed by Filter: 2
20. 12.960 541.080 ↓ 2.0 2 1,080

Bitmap Heap Scan on transfers (cost=38.75..42.76 rows=1 width=8) (actual time=0.497..0.501 rows=2 loops=1,080)

  • Recheck Cond: ((to_id = $5) AND (type_id = 36))
  • Heap Blocks: exact=1769
21. 33.080 528.120 ↓ 0.0 0 1,080

BitmapAnd (cost=38.75..38.75 rows=1 width=0) (actual time=0.489..0.489 rows=0 loops=1,080)

22. 14.040 14.040 ↑ 102.0 2 1,080

Bitmap Index Scan on ix_transfers_fk_transfers_to_id (cost=0.00..5.96 rows=204 width=0) (actual time=0.013..0.013 rows=2 loops=1,080)

  • Index Cond: (to_id = $5)
23. 481.000 481.000 ↓ 1.2 1,861 962

Bitmap Index Scan on ix_transfers_fk_transfers_type_id (cost=0.00..32.54 rows=1,615 width=0) (actual time=0.500..0.500 rows=1,861 loops=962)

  • Index Cond: (type_id = 36)
24. 0.000 508.680 ↑ 1.0 1 1,080

Aggregate (cost=52.10..52.11 rows=1 width=32) (actual time=0.471..0.471 rows=1 loops=1,080)

25.          

Initplan (for Aggregate)

26. 11.880 11.880 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_1 (cost=0.42..9.34 rows=1 width=8) (actual time=0.008..0.011 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 10)
  • Rows Removed by Filter: 2
27. 5.400 496.800 ↓ 2.0 2 1,080

Bitmap Heap Scan on transfers transfers_1 (cost=38.75..42.76 rows=1 width=6) (actual time=0.459..0.460 rows=2 loops=1,080)

  • Recheck Cond: ((to_id = $7) AND (type_id = 36))
  • Heap Blocks: exact=1769
28. 17.388 491.400 ↓ 0.0 0 1,080

BitmapAnd (cost=38.75..38.75 rows=1 width=0) (actual time=0.455..0.455 rows=0 loops=1,080)

29. 6.480 6.480 ↑ 102.0 2 1,080

Bitmap Index Scan on ix_transfers_fk_transfers_to_id (cost=0.00..5.96 rows=204 width=0) (actual time=0.006..0.006 rows=2 loops=1,080)

  • Index Cond: (to_id = $7)
30. 467.532 467.532 ↓ 1.2 1,861 962

Bitmap Index Scan on ix_transfers_fk_transfers_type_id (cost=0.00..32.54 rows=1,615 width=0) (actual time=0.486..0.486 rows=1,861 loops=962)

  • Index Cond: (type_id = 36)
31. 8.640 19.440 ↑ 1.0 1 1,080

Index Scan using account_balances_pkey on account_balances (cost=9.63..17.64 rows=1 width=6) (actual time=0.018..0.018 rows=1 loops=1,080)

  • Index Cond: (account_id = $9)
32.          

Initplan (for Index Scan)

33. 10.800 10.800 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_2 (cost=0.42..9.34 rows=1 width=8) (actual time=0.007..0.010 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 10)
  • Rows Removed by Filter: 2
34. 3.240 504.360 ↑ 1.0 1 1,080

Aggregate (cost=52.10..52.11 rows=1 width=32) (actual time=0.466..0.467 rows=1 loops=1,080)

35.          

Initplan (for Aggregate)

36. 8.640 8.640 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_3 (cost=0.42..9.34 rows=1 width=8) (actual time=0.006..0.008 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 10)
  • Rows Removed by Filter: 2
37. 5.400 492.480 ↓ 2.0 2 1,080

Bitmap Heap Scan on transfers transfers_2 (cost=38.75..42.76 rows=1 width=6) (actual time=0.455..0.456 rows=2 loops=1,080)

  • Recheck Cond: ((to_id = $11) AND (type_id = 36))
  • Heap Blocks: exact=1769
38. 14.148 487.080 ↓ 0.0 0 1,080

BitmapAnd (cost=38.75..38.75 rows=1 width=0) (actual time=0.451..0.451 rows=0 loops=1,080)

39. 5.400 5.400 ↑ 102.0 2 1,080

Bitmap Index Scan on ix_transfers_fk_transfers_to_id (cost=0.00..5.96 rows=204 width=0) (actual time=0.005..0.005 rows=2 loops=1,080)

  • Index Cond: (to_id = $11)
40. 467.532 467.532 ↓ 1.2 1,861 962

Bitmap Index Scan on ix_transfers_fk_transfers_type_id (cost=0.00..32.54 rows=1,615 width=0) (actual time=0.486..0.486 rows=1,861 loops=962)

  • Index Cond: (type_id = 36)
41. 0.000 502.200 ↑ 1.0 1 1,080

Aggregate (cost=52.10..52.11 rows=1 width=32) (actual time=0.465..0.465 rows=1 loops=1,080)

42.          

Initplan (for Aggregate)

43. 9.720 9.720 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_4 (cost=0.42..9.34 rows=1 width=8) (actual time=0.007..0.009 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 10)
  • Rows Removed by Filter: 2
44. 6.480 493.560 ↓ 2.0 2 1,080

Bitmap Heap Scan on transfers transfers_3 (cost=38.75..42.76 rows=1 width=6) (actual time=0.455..0.457 rows=2 loops=1,080)

  • Recheck Cond: ((to_id = $13) AND (type_id = 36))
  • Heap Blocks: exact=1769
45. 15.110 487.080 ↓ 0.0 0 1,080

BitmapAnd (cost=38.75..38.75 rows=1 width=0) (actual time=0.451..0.451 rows=0 loops=1,080)

46. 5.400 5.400 ↑ 102.0 2 1,080

Bitmap Index Scan on ix_transfers_fk_transfers_to_id (cost=0.00..5.96 rows=204 width=0) (actual time=0.005..0.005 rows=2 loops=1,080)

  • Index Cond: (to_id = $13)
47. 466.570 466.570 ↓ 1.2 1,861 962

Bitmap Index Scan on ix_transfers_fk_transfers_type_id (cost=0.00..32.54 rows=1,615 width=0) (actual time=0.485..0.485 rows=1,861 loops=962)

  • Index Cond: (type_id = 36)
48. 0.000 511.920 ↑ 1.0 1 1,080

Limit (cost=52.11..52.11 rows=1 width=16) (actual time=0.473..0.474 rows=1 loops=1,080)

49.          

Initplan (for Limit)

50. 10.800 10.800 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_5 (cost=0.42..9.34 rows=1 width=8) (actual time=0.008..0.010 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 10)
  • Rows Removed by Filter: 2
51. 9.720 507.600 ↑ 1.0 1 1,080

Sort (cost=42.77..42.78 rows=1 width=16) (actual time=0.470..0.470 rows=1 loops=1,080)

  • Sort Key: transfers_4.id
  • Sort Method: quicksort Memory: 25kB
52. 7.560 497.880 ↓ 2.0 2 1,080

Bitmap Heap Scan on transfers transfers_4 (cost=38.75..42.76 rows=1 width=16) (actual time=0.459..0.461 rows=2 loops=1,080)

  • Recheck Cond: ((to_id = $15) AND (type_id = 36))
  • Heap Blocks: exact=1769
53. 16.426 490.320 ↓ 0.0 0 1,080

BitmapAnd (cost=38.75..38.75 rows=1 width=0) (actual time=0.454..0.454 rows=0 loops=1,080)

54. 5.400 5.400 ↑ 102.0 2 1,080

Bitmap Index Scan on ix_transfers_fk_transfers_to_id (cost=0.00..5.96 rows=204 width=0) (actual time=0.005..0.005 rows=2 loops=1,080)

  • Index Cond: (to_id = $15)
55. 468.494 468.494 ↓ 1.2 1,861 962

Bitmap Index Scan on ix_transfers_fk_transfers_type_id (cost=0.00..32.54 rows=1,615 width=0) (actual time=0.487..0.487 rows=1,861 loops=962)

  • Index Cond: (type_id = 36)
56. 0.000 511.920 ↑ 1.0 1 1,080

Limit (cost=52.11..52.11 rows=1 width=16) (actual time=0.473..0.474 rows=1 loops=1,080)

57.          

Initplan (for Limit)

58. 10.800 10.800 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_6 (cost=0.42..9.34 rows=1 width=8) (actual time=0.007..0.010 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 10)
  • Rows Removed by Filter: 2
59. 8.640 508.680 ↑ 1.0 1 1,080

Sort (cost=42.77..42.78 rows=1 width=16) (actual time=0.471..0.471 rows=1 loops=1,080)

  • Sort Key: transfers_5.id
  • Sort Method: quicksort Memory: 25kB
60. 6.480 500.040 ↓ 2.0 2 1,080

Bitmap Heap Scan on transfers transfers_5 (cost=38.75..42.76 rows=1 width=16) (actual time=0.461..0.463 rows=2 loops=1,080)

  • Recheck Cond: ((to_id = $17) AND (type_id = 36))
  • Heap Blocks: exact=1769
61. 16.780 493.560 ↓ 0.0 0 1,080

BitmapAnd (cost=38.75..38.75 rows=1 width=0) (actual time=0.457..0.457 rows=0 loops=1,080)

62. 5.400 5.400 ↑ 102.0 2 1,080

Bitmap Index Scan on ix_transfers_fk_transfers_to_id (cost=0.00..5.96 rows=204 width=0) (actual time=0.005..0.005 rows=2 loops=1,080)

  • Index Cond: (to_id = $17)
63. 471.380 471.380 ↓ 1.2 1,861 962

Bitmap Index Scan on ix_transfers_fk_transfers_type_id (cost=0.00..32.54 rows=1,615 width=0) (actual time=0.490..0.490 rows=1,861 loops=962)

  • Index Cond: (type_id = 36)
64. 83.160 725.760 ↑ 1.0 1 1,080

Aggregate (cost=608.91..608.92 rows=1 width=32) (actual time=0.672..0.672 rows=1 loops=1,080)

65.          

Initplan (for Aggregate)

66. 10.800 10.800 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_7 (cost=0.42..9.34 rows=1 width=8) (actual time=0.007..0.010 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 10)
  • Rows Removed by Filter: 2
67. 631.800 631.800 ↓ 4.1 182 1,080

Index Scan using ix_transfers_fk_transfers_from_id on transfers transfers_6 (cost=0.43..599.46 rows=44 width=6) (actual time=0.023..0.585 rows=182 loops=1,080)

  • Index Cond: (from_id = $19)
  • Filter: ((subclass)::text = 'TRANSFER_FEE'::text)
  • Rows Removed by Filter: 0
68. 0.000 521.640 ↑ 1.0 1 1,080

Limit (cost=52.11..52.11 rows=1 width=16) (actual time=0.482..0.483 rows=1 loops=1,080)

69.          

Initplan (for Limit)

70. 9.720 9.720 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_8 (cost=0.42..9.34 rows=1 width=8) (actual time=0.007..0.009 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 10)
  • Rows Removed by Filter: 2
71. 8.640 517.320 ↑ 1.0 1 1,080

Sort (cost=42.77..42.78 rows=1 width=16) (actual time=0.479..0.479 rows=1 loops=1,080)

  • Sort Key: transfers_7.id
  • Sort Method: quicksort Memory: 25kB
72. 7.560 508.680 ↓ 2.0 2 1,080

Bitmap Heap Scan on transfers transfers_7 (cost=38.75..42.76 rows=1 width=16) (actual time=0.469..0.471 rows=2 loops=1,080)

  • Recheck Cond: ((to_id = $21) AND (type_id = 36))
  • Heap Blocks: exact=1769
73. 16.290 501.120 ↓ 0.0 0 1,080

BitmapAnd (cost=38.75..38.75 rows=1 width=0) (actual time=0.464..0.464 rows=0 loops=1,080)

74. 8.640 8.640 ↑ 102.0 2 1,080

Bitmap Index Scan on ix_transfers_fk_transfers_to_id (cost=0.00..5.96 rows=204 width=0) (actual time=0.007..0.008 rows=2 loops=1,080)

  • Index Cond: (to_id = $21)
75. 476.190 476.190 ↓ 1.2 1,861 962

Bitmap Index Scan on ix_transfers_fk_transfers_type_id (cost=0.00..32.54 rows=1,615 width=0) (actual time=0.495..0.495 rows=1,861 loops=962)

  • Index Cond: (type_id = 36)
76. 0.000 517.320 ↑ 1.0 1 1,080

Limit (cost=52.11..52.11 rows=1 width=16) (actual time=0.477..0.479 rows=1 loops=1,080)

77.          

Initplan (for Limit)

78. 10.800 10.800 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_9 (cost=0.42..9.34 rows=1 width=8) (actual time=0.008..0.010 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 10)
  • Rows Removed by Filter: 2
79. 8.640 513.000 ↑ 1.0 1 1,080

Sort (cost=42.77..42.78 rows=1 width=16) (actual time=0.475..0.475 rows=1 loops=1,080)

  • Sort Key: transfers_8.id
  • Sort Method: quicksort Memory: 25kB
80. 6.480 504.360 ↓ 2.0 2 1,080

Bitmap Heap Scan on transfers transfers_8 (cost=38.75..42.76 rows=1 width=16) (actual time=0.465..0.467 rows=2 loops=1,080)

  • Recheck Cond: ((to_id = $23) AND (type_id = 36))
  • Heap Blocks: exact=1769
81. 18.214 497.880 ↓ 0.0 0 1,080

BitmapAnd (cost=38.75..38.75 rows=1 width=0) (actual time=0.460..0.461 rows=0 loops=1,080)

82. 5.400 5.400 ↑ 102.0 2 1,080

Bitmap Index Scan on ix_transfers_fk_transfers_to_id (cost=0.00..5.96 rows=204 width=0) (actual time=0.005..0.005 rows=2 loops=1,080)

  • Index Cond: (to_id = $23)
83. 474.266 474.266 ↓ 1.2 1,861 962

Bitmap Index Scan on ix_transfers_fk_transfers_type_id (cost=0.00..32.54 rows=1,615 width=0) (actual time=0.493..0.493 rows=1,861 loops=962)

  • Index Cond: (type_id = 36)
84. 69.120 1,208.520 ↑ 1.0 1 1,080

Aggregate (cost=609.67..609.68 rows=1 width=32) (actual time=1.119..1.119 rows=1 loops=1,080)

85.          

Initplan (for Aggregate)

86. 10.800 10.800 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_10 (cost=0.42..9.34 rows=1 width=8) (actual time=0.008..0.010 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 4)
  • Rows Removed by Filter: 2
87. 1,128.600 1,128.600 ↓ 182.0 182 1,080

Index Scan using ix_transfers_fk_transfers_from_id on transfers transfers_9 (cost=0.43..600.32 rows=1 width=6) (actual time=0.455..1.045 rows=182 loops=1,080)

  • Index Cond: (from_id = $25)
  • Filter: (((subclass)::text = 'TRANSFER_FEE'::text) AND (transfer_fee_id = 4) AND (type_id = 26))
  • Rows Removed by Filter: 178
88. 35.640 564.840 ↑ 1.0 1 1,080

Aggregate (cost=609.66..609.67 rows=1 width=8) (actual time=0.523..0.523 rows=1 loops=1,080)

89.          

Initplan (for Aggregate)

90. 10.800 10.800 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_11 (cost=0.42..9.34 rows=1 width=8) (actual time=0.009..0.010 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 4)
  • Rows Removed by Filter: 2
91. 518.400 518.400 ↓ 182.0 182 1,080

Index Scan using ix_transfers_fk_transfers_from_id on transfers transfers_10 (cost=0.43..600.32 rows=1 width=8) (actual time=0.149..0.480 rows=182 loops=1,080)

  • Index Cond: (from_id = $27)
  • Filter: (((subclass)::text = 'TRANSFER_FEE'::text) AND (transfer_fee_id = 4) AND (type_id = 26))
  • Rows Removed by Filter: 178
92. 9.804 97.200 ↑ 1.0 1 1,080

Nested Loop (cost=0.85..22.10 rows=1 width=8) (actual time=0.083..0.090 rows=1 loops=1,080)

93. 4.320 74.520 ↑ 1.0 1 1,080

Nested Loop (cost=0.43..13.64 rows=1 width=16) (actual time=0.064..0.069 rows=1 loops=1,080)

94. 43.200 43.200 ↑ 1.0 1 1,080

Seq Scan on user_custom_fields (cost=0.00..4.25 rows=1 width=8) (actual time=0.035..0.040 rows=1 loops=1,080)

  • Filter: ((internal_name)::text = 'contractSignedOn'::text)
  • Rows Removed by Filter: 99
95. 27.000 27.000 ↑ 1.0 1 1,080

Index Scan using unq_user_custom_field_values_0 on user_custom_field_values (cost=0.43..8.45 rows=1 width=24) (actual time=0.025..0.025 rows=1 loops=1,080)

  • Index Cond: ((owner_id = esercenti.id) AND (field_id = user_custom_fields.id))
96. 12.876 12.876 ↑ 1.0 1 1,073

Index Only Scan using users_pkey on users innerusers (cost=0.42..8.44 rows=1 width=8) (actual time=0.011..0.012 rows=1 loops=1,073)

  • Index Cond: (id = esercenti.id)
  • Heap Fetches: 1073
97. 4.320 14.040 ↑ 1.0 1 1,080

Index Scan using account_balances_pkey on account_balances account_balances_1 (cost=9.63..17.64 rows=1 width=6) (actual time=0.012..0.013 rows=1 loops=1,080)

  • Index Cond: (account_id = $31)
98.          

Initplan (for Index Scan)

99. 9.720 9.720 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_12 (cost=0.42..9.34 rows=1 width=8) (actual time=0.008..0.009 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 4)
  • Rows Removed by Filter: 2
100. 65.880 358.560 ↑ 1.0 1 1,080

Aggregate (cost=678.10..678.11 rows=1 width=32) (actual time=0.332..0.332 rows=1 loops=1,080)

101.          

Initplan (for Aggregate)

102. 8.640 8.640 ↑ 1.0 1 1,080

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_13 (cost=0.42..9.34 rows=1 width=8) (actual time=0.006..0.008 rows=1 loops=1,080)

  • Index Cond: (user_id = esercenti.id)
  • Filter: (account_type_id = 5)
  • Rows Removed by Filter: 2
103. 284.040 284.040 ↓ 6.7 182 1,080

Index Scan using ix_transfers_fk_transfers_to_id on transfers transfers_11 (cost=0.43..668.69 rows=27 width=6) (actual time=0.012..0.263 rows=182 loops=1,080)

  • Index Cond: (to_id = $33)
  • Filter: (type_id = 23)
104. 30.240 267.840 ↑ 1.0 1 1,080

Aggregate (cost=852.44..852.45 rows=1 width=8) (actual time=0.248..0.248 rows=1 loops=1,080)

105. 201.960 237.600 ↓ 5.4 134 1,080

Bitmap Heap Scan on user_custom_field_values user_custom_field_values_1 (cost=6.13..852.38 rows=25 width=8) (actual time=0.051..0.220 rows=134 loops=1,080)

  • Recheck Cond: (linked_entity_id = esercenti.id)
  • Filter: (field_id = 85)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=26219
106. 35.640 35.640 ↑ 1.7 135 1,080

Bitmap Index Scan on ix_user_custom_field_values_linked_entity_id (cost=0.00..6.12 rows=226 width=0) (actual time=0.033..0.033 rows=135 loops=1,080)

  • Index Cond: (linked_entity_id = esercenti.id)
107. 6.480 1,128.600 ↑ 1.0 1 1,080

Aggregate (cost=1,063.45..1,063.46 rows=1 width=8) (actual time=1.044..1.045 rows=1 loops=1,080)

108. 120.546 1,122.120 ↓ 10.0 10 1,080

Nested Loop (cost=6.55..1,063.44 rows=1 width=8) (actual time=0.400..1.039 rows=10 loops=1,080)

109. 106.920 131.760 ↓ 5.4 134 1,080

Bitmap Heap Scan on user_custom_field_values user_custom_field_values_2 (cost=6.13..852.38 rows=25 width=16) (actual time=0.031..0.122 rows=134 loops=1,080)

  • Recheck Cond: (linked_entity_id = esercenti.id)
  • Filter: (field_id = 85)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=26219
110. 24.840 24.840 ↑ 1.7 135 1,080

Bitmap Index Scan on ix_user_custom_field_values_linked_entity_id (cost=0.00..6.12 rows=226 width=0) (actual time=0.023..0.023 rows=135 loops=1,080)

  • Index Cond: (linked_entity_id = esercenti.id)
111. 869.814 869.814 ↓ 0.0 0 144,969

Index Scan using users_pkey on users registered_users (cost=0.42..8.44 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=144,969)

  • Index Cond: (id = user_custom_field_values_2.owner_id)
  • Filter: (user_group_id = 23)
  • Rows Removed by Filter: 1
112. 10.800 38,429.640 ↑ 1.0 1 1,080

Aggregate (cost=20,167.35..20,167.36 rows=1 width=8) (actual time=35.583..35.583 rows=1 loops=1,080)

113. 210.105 38,418.840 ↓ 1.8 14 1,080

Bitmap Heap Scan on user_custom_field_values user_custom_field_values_3 (cost=4,847.43..20,167.33 rows=8 width=8) (actual time=34.119..35.573 rows=14 loops=1,080)

  • Recheck Cond: ((linked_entity_id = esercenti.id) AND (field_id = 85))
  • Filter: ((SubPlan 36) > 0)
  • Rows Removed by Filter: 120
  • Heap Blocks: exact=25416
114. 16.089 36,034.200 ↓ 0.0 0 1,080

BitmapAnd (cost=4,847.43..4,847.43 rows=25 width=0) (actual time=33.365..33.365 rows=0 loops=1,080)

115. 24.840 24.840 ↑ 1.7 135 1,080

Bitmap Index Scan on ix_user_custom_field_values_linked_entity_id (cost=0.00..6.12 rows=226 width=0) (actual time=0.023..0.023 rows=135 loops=1,080)

  • Index Cond: (linked_entity_id = esercenti.id)
116. 35,993.271 35,993.271 ↑ 1.0 250,790 993

Bitmap Index Scan on ix_user_custom_field_values_field_id (cost=0.00..4,841.06 rows=261,950 width=0) (actual time=36.247..36.247 rows=250,790 loops=993)

  • Index Cond: (field_id = 85)
117.          

SubPlan (for Bitmap Heap Scan)

118. 0.000 2,174.535 ↑ 1.0 1 144,969

Limit (cost=608.86..608.87 rows=1 width=8) (actual time=0.014..0.015 rows=1 loops=144,969)

119.          

Initplan (for Limit)

120. 869.814 869.814 ↑ 1.0 1 144,969

Index Scan using ix_accounts_fk_accounts_user_id on accounts accounts_14 (cost=0.42..9.34 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=144,969)

  • Index Cond: (user_id = user_custom_field_values_3.owner_id)
  • Filter: (account_type_id = 8)
  • Rows Removed by Filter: 1
121. 1,159.752 2,029.566 ↑ 1.0 1 144,969

Aggregate (cost=599.52..599.53 rows=1 width=8) (actual time=0.014..0.014 rows=1 loops=144,969)

122. 869.814 869.814 ↑ 23.0 1 144,969

Index Scan using ix_transfers_fk_transfers_from_id on transfers transfers_12 (cost=0.43..599.46 rows=23 width=8) (actual time=0.003..0.006 rows=1 loops=144,969)

  • Index Cond: (from_id = $38)
  • Filter: (type_id = 23)
123. 275.484 3,030.324 ↑ 1.0 1 275,484

Aggregate (cost=18.92..18.93 rows=1 width=8) (actual time=0.010..0.011 rows=1 loops=275,484)

124. 458.289 2,754.840 ↓ 0.0 0 275,484

Nested Loop (cost=0.57..18.92 rows=1 width=8) (actual time=0.010..0.010 rows=0 loops=275,484)

125. 1,377.420 1,377.420 ↑ 1.0 1 275,484

Index Scan using ix_user_group_logs_fk_user_group_logs_user_id on user_group_logs user_group_logs_1 (cost=0.42..8.45 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=275,484)

  • Index Cond: (esercenti.id = user_id)
  • Filter: (start_date <= now())
126. 919.131 919.131 ↓ 0.0 0 306,377

Index Scan using groups_pkey on groups groups_2 (cost=0.15..8.18 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=306,377)

  • Index Cond: (id = user_group_logs_1.group_id)
  • Filter: (((name)::text = 'SRD.B2B.B2E.B2C'::text) OR ((name)::text = 'SRD.B2B.B2E.B2C.Shadow'::text) OR ((name)::text = 'SRD.B2B.B2E.B2C.Solo.Ricarica.Shadow'::text) OR ((name)::text = 'SRD.B2B.B2E.B2C.SoloAccettazione'::text) OR ((name)::text = 'SRD.B2B.B2E.B2C.SoloAccettazione.Shadow'::text) OR ((name)::text = 'SRD.B2B.B2E.B2C.SoloRicarica'::text))
  • Rows Removed by Filter: 1
Planning time : 10.448 ms