# Result: KvKn

Settings

### Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.480 949.930 ↓ 0.0 0 1

(cost=60,657.97..80,612.69 rows=1 width=37) (actual time=949.93..949.93 rows=0 loops=1)

2. 52.097 244.978 ↓ 25.2 4,078 1

(cost=9,872.68..29,826.78 rows=162 width=114) (actual time=132.572..244.978 rows=4,078 loops=1)

3. 98.973 98.973 ↑ 1.0 420,268 1

Seq Scan on calculation calculation (cost=0..18,835.85 rows=425,885 width=76) (actual time=0.007..98.973 rows=420,268 loops=1)

4. 0.070 93.908 ↓ 47.5 285 1

(cost=9,872.61..9,872.61 rows=6 width=38) (actual time=93.908..93.908 rows=285 loops=1)

• Buffers: shared hit=2690
5. 0.126 93.838 ↓ 47.5 285 1

(cost=9,867.92..9,872.55 rows=6 width=38) (actual time=88.307..93.838 rows=285 loops=1)

• Buffers: shared hit=2690
6. 0.000 93.712 ↓ 188.7 1,132 1

Gather Merge (cost=9,867.92..9,872.53 rows=6 width=38) (actual time=88.306..93.712 rows=1,132 loops=1)

• Buffers: shared hit=5084
7. 7.818 180.940 ↓ 141.5 566 2

(cost=8,867.91..8,871.85 rows=4 width=38) (actual time=85.439..90.47 rows=566 loops=2)

• Buffers: shared hit=5084
8. 78.084 146.242 ↓ 24.8 14,878 2

(cost=7,081.14..7,082.64 rows=599 width=38) (actual time=71.925..73.121 rows=14,878 loops=2)

• Sort Method: quicksort Memory: 1581kB
• Buffers: shared hit=2866
9. 68.158 68.158 ↓ 25.0 14,994 2

Seq Scan on user_login user_login (cost=0..7,053.51 rows=599 width=38) (actual time=23.738..34.079 rows=14,994 loops=2)

• Filter: (((to_timestamp(((user_login."timestamp" / 1000))::double precision))::date >= '2019-05-01'::date) AND ((to_timestamp(((user_login."timestamp" / 1000))::double precision))::date <= '2019-05-08'::date))
• Buffers: shared hit=2861
10. 5.028 26.880 ↓ 2.8 805 2

(cost=1,786.76..1,787.48 rows=288 width=39) (actual time=13.371..13.44 rows=805 loops=2)

• Sort Key: "user".user_id
• Sort Method: quicksort Memory: 87kB
• Buffers: shared hit=2218
11. 21.852 21.852 ↓ 2.8 805 2

Seq Scan on user user (cost=0..1,775 rows=288 width=39) (actual time=0.08..10.926 rows=805 loops=2)

• Filter: (("user".ip IS NOT NULL) AND (("user".country)::text = 'Netherlands'::text))
• Buffers: shared hit=2218
12. 0.010 704.472 ↑ 5.4 9 1

(cost=50,784.68..50,784.68 rows=49 width=78) (actual time=704.472..704.472 rows=9 loops=1)

13. 0.785 704.462 ↑ 5.4 9 1

(cost=50,754..50,784.68 rows=49 width=78) (actual time=697.473..704.462 rows=9 loops=1)

14. 4.074 204.784 ↓ 1.5 2,530 1

(cost=22,499.11..22,507.81 rows=1,650 width=39) (actual time=197.676..204.784 rows=2,530 loops=1)

15. 56.746 200.710 ↓ 18.3 31,789 1

(cost=22,499.11..22,503.46 rows=1,740 width=39) (actual time=197.675..200.71 rows=31,789 loops=1)

• Sort Key: calculation_1.user_id
• Sort Method: quicksort Memory: 3265kB
16. 4.620 143.964 ↓ 18.4 31,953 1

Gather (cost=1,000..22,405.45 rows=1,740 width=39) (actual time=0.265..143.964 rows=31,953 loops=1)

17. 139.344 139.344 ↓ 14.7 10,651 3

Seq Scan on calculation calculation_1 (cost=0..21,231.45 rows=725 width=39) (actual time=0.763..139.344 rows=10,651 loops=3)

• Filter: (((calculation_1.function_name)::text = 'esod-singlebearing-prod-handler'::text) AND ((to_timestamp(((calculation_1."timestamp" / 1000))::double precision))::date >= '2019-05-01'::date) AND ((to_timestamp(((calculation_1."timestamp" / 1000))::double precision))::date <= '2019-05-08'::date))
18. 0.115 498.893 ↑ 2.5 20 1

(cost=28,254.9..28,255.14 rows=49 width=39) (actual time=498.713..498.893 rows=20 loops=1)

19. 0.452 498.778 ↓ 21.2 1,037 1

(cost=28,254.9..28,255.02 rows=49 width=39) (actual time=498.712..498.778 rows=1,037 loops=1)

• Sort Key: calculation_2.user_id
• Sort Method: quicksort Memory: 130kB
20. 5.679 498.326 ↓ 21.2 1,037 1

Gather (cost=1,000.42..28,253.52 rows=49 width=39) (actual time=58.944..498.326 rows=1,037 loops=1)

21. 345.083 492.647 ↓ 17.3 346 3

(cost=0.42..27,248.62 rows=20 width=39) (actual time=56.586..492.647 rows=346 loops=3)