explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BZoG

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 1,131,674.396 ↓ 0.0 0 1

Limit (cost=31,690,519.46..31,690,519.56 rows=40 width=61) (actual time=1,131,674.395..1,131,674.396 rows=0 loops=1)

2. 0.018 1,131,674.391 ↓ 0.0 0 1

Sort (cost=31,690,519.46..31,690,554.71 rows=14,100 width=61) (actual time=1,131,674.391..1,131,674.391 rows=0 loops=1)

  • Sort Key: statistic_coupon_downloads.date_and_time DESC NULLS LAST, statistic_coupon_downloads.id
  • Sort Method: quicksort Memory: 25kB
3. 0.010 1,131,674.373 ↓ 0.0 0 1

WindowAgg (cost=1.15..31,690,073.77 rows=14,100 width=61) (actual time=1,131,674.372..1,131,674.373 rows=0 loops=1)

4. 0.004 1,131,674.363 ↓ 0.0 0 1

Nested Loop (cost=1.15..31,689,756.52 rows=14,100 width=28) (actual time=1,131,674.362..1,131,674.363 rows=0 loops=1)

  • Join Filter: (statistic_coupon_downloads.user_id = statistic_user_compound.user_id)
5. 242.177 1,131,674.359 ↓ 0.0 0 1

Nested Loop (cost=0.72..31,653,144.57 rows=15,296 width=36) (actual time=1,131,674.358..1,131,674.359 rows=0 loops=1)

6. 455.790 1,130,629.633 ↓ 2.2 72,959 1

Nested Loop (cost=0.43..31,549,352.88 rows=33,437 width=40) (actual time=752,020.765..1,130,629.633 rows=72,959 loops=1)

7. 1,129,006.419 1,129,006.419 ↑ 1.1 72,964 1

Seq Scan on statistic_coupon_downloads (cost=0.00..31,362,390.60 rows=77,963 width=29) (actual time=752,020.623..1,129,006.419 rows=72,964 loops=1)

  • Filter: ((date_and_time >= '2010-09-27 00:00:00'::timestamp without time zone) AND (date_and_time <= '2019-10-04 23:59:00'::timestamp without time zone) AND (coupon_id = 5488811))
  • Rows Removed by Filter: 733571194
8. 1,167.424 1,167.424 ↑ 1.0 1 72,964

Index Scan using statistic_user_compound_has_subsidiary_country_pkey on statistic_user_compound_has_subsidiary_country (cost=0.43..2.39 rows=1 width=11) (actual time=0.014..0.016 rows=1 loops=72,964)

  • Index Cond: ((statistic_user_compound_user_id = statistic_coupon_downloads.user_id) AND (subsidiary_country_id = 2650))
9. 802.549 802.549 ↓ 0.0 0 72,959

Index Scan using retailer_store_pk on retailer_store (cost=0.29..3.09 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=72,959)

  • Index Cond: (id = statistic_coupon_downloads.retailer_store_id)
  • Filter: (administrative_instance_id = ANY ('{50,400,402,403,401,405,404,52,406,53,13300,13202,12951,13201,6700,54,13551,1400,6800,55,56,3500,13950,8853,14000,13200,2153,51,500,14100,13251,9951,9950,13000,202,14050,13250,203,13600,204,206,207,350,208,255,600,550,450,700,1100,850,900,950,1050,1200,1300,12552,12601,1350,13100,13550,13101,13150,13151,1450,11400,10254,10103,4851,4352,9450,4353,10308,6250,6950,5751,5950,9000,5850,6003,4750,5050,3450,6151,11600,7803,5250,6152,5852,4653,10150,10253,4357,3405,6500,3853,4355,4650,8503,8201,7652,10000,11450,4500,10151,6305,8850,8855,6102,3801,8350,10600,4101,5452,3753,5550,4250,8000,4700,3600,6801,3700,6400,3406,10601,4151,6551,3407,9750,10309,10950,7800,6253,8600,3851,6101,4901,8900,5761,5707,5000,3900,7150,4153,5451,5801,8753,4850,7100,4600,4100,10451,8752,6503,9100,3402,10900,3401,5001,5706,10110,6200,5701,4251,10751,10107,7051,5754,10101,4400,6905,9850,3750,5760,9600,3604,10050,5700,11001,6252,3506,3800,10313,6504,10100,8250,4951,10500,5352,4356,4354,10651,4501,8050,5350,5755,10108,5002,6150,3503,4652,6350,4651,7700,7750,10106,10800,8051,10301,10300,6750,4502,10152,5450,6307,3852,10603,6001,6251,3653,3605,3404,3651,5100,6601,6600,6303,8851,5703,3351,3601,8400,8800,11251,4300,7650,5762,3652,5753,7101,6902,6201,4950,10315,10312,5401,6300,5752,7850,4450,5501,3856,5704,5500,6202,10951,4350,6100,4200,5200,10350,6451,6852,10311,4152,3655,10250,7151,10307,6306,6904,10102,8150,10450,4050,11300,6000,8901,3508,5851,8200,10304,5756,10314,8450,6304,7802,3507,8754,5750,3950,5800,3504,8101,3603,10001,5702,4800,6002,10310,4801,10750,6552,10303,10251,4252,10104,3650,10952,10105,5101,6900,10400,6853,3502,10550,6450,4900,7000,3850,5650,10111,6501,3751,5758,9650,6301,4150,5152,5600,8502,3855,10252,7901,10851,10650,8100,4550,10953,4701,6452,9400,11700,11050,5351,10306,3451,7152,3854,4102,8750,9350,7651,6901,3400,5705,5003,5150,10700,6153,6050,10305,4852,6302,4103,8856,8251,8751,8300,3602,7801,7950,3505,3901,4351,6454,8950,5900,10109,5400,5251,5151,5759,10602,11150,6850,4654,6453,8501,10302,6903,4702,5757,4001,3550,6851,3654,11350,10153,7200,8852,6650,9651,11000,3403,9800,3656,10850,10316,7050,3752,11701,8001,4000,7900,8951,8552,12350,9050,9515,9504,8583,8652,8701,11100,11512,8553,8579,8702,8550,9508,11510,11101,9514,12001,8592,6502,8704,8562,8568,8653,3501,9052,9518,8574,11502,9700,8575,8567,11500,8703,11105,8588,8581,11103,8587,8854,11511,9502,8654,12100,8555,11501,9510,9517,8569,8572,9513,11507,8563,2250,8595,8560,8576,8551,8578,9051,11509,8591,9516,11503,2704,8573,9511,2712,9506,11505,8584,11508,11102,8571,8700,8500,8589,8585,8566,9053,11104,9512,8580,8594,11504,11850,11950,2151,8593,8558,8577,3001,2711,2252,9505,8559,8582,9501,8651,8565,8556,8650,3002,8564,8557,8554,9500,9503,9509,8586,8590,8596,11506,8570,2152,2551,9054,6550,9507,8451,8561,3101,2400,3256,1602,2304,3200,2050,1550,2850,1650,3253,3250,2155,2401,3104,2000,2451,2200,1950,2713,2700,2450,2901,2750,3007,3005,3102,2550,2852,3054,3050,3255,2454,3105,3053,2402,2600,1850,2350,2851,3150,3006,1900,2950,1751,2302,2452,3252,2453,1604,2702,2500,2751,3106,2800,2303,3254,3103,2650,1852,1750,1600,3051,2251,1800,1851,2701,1700,1500,1601,2300,3251,3003,1752,2301,3004,3100,1603,3300,3000,1605,2455,5300,7701,9250,9303,9301,9300,9551,9302,9550,9150,9200,9201,9914,9903,9920,9918,9909,10203,10202,10204,9907,9901,10208,9902,9917,9919,9904,9910,10206,9911,9900,9905,9908,10207,9906,10200,10210,10112,12150,11550,11750,11800,11900,12200,12250,12400,12401,12402,12650,12750,12851,12850,12950,13050,13301,13450,13352,13400,13350,13351,13500,13900}'::integer[]))
  • Rows Removed by Filter: 1
10. 0.000 0.000 ↓ 0.0 0

Index Only Scan using statistic_user_compound_pkey on statistic_user_compound (cost=0.43..2.38 rows=1 width=4) (never executed)

  • Index Cond: (user_id = statistic_user_compound_has_subsidiary_country.statistic_user_compound_user_id)
  • Heap Fetches: 0