explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kFhO : Optimization for: Optimization for: plan #学员列表; plan #P3Yf

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.004 7.567 ↓ 20.0 20 1

Limit (cost=1,108.79..1,114.15 rows=1 width=8) (actual time=7.544..7.567 rows=20 loops=1)

2. 0.005 7.563 ↓ 20.0 20 1

Subquery Scan on base (cost=1,108.79..1,114.15 rows=1 width=8) (actual time=7.543..7.563 rows=20 loops=1)

  • Filter: (base.rank = 1)
  • Rows Removed by Filter: 5
3. 0.022 7.558 ↑ 6.6 25 1

WindowAgg (cost=1,108.79..1,112.09 rows=165 width=98) (actual time=7.541..7.558 rows=25 loops=1)

4. 0.166 7.536 ↑ 5.9 28 1

Sort (cost=1,108.79..1,109.20 rows=165 width=8) (actual time=7.533..7.536 rows=28 loops=1)

  • Sort Key: user_student.id DESC
  • Sort Method: quicksort Memory: 54kB
5. 0.398 7.370 ↓ 3.8 625 1

Nested Loop (cost=1.97..1,102.71 rows=165 width=8) (actual time=0.177..7.370 rows=625 loops=1)

6. 0.056 6.344 ↓ 1.7 628 1

Nested Loop (cost=1.69..981.38 rows=379 width=8) (actual time=0.168..6.344 rows=628 loops=1)

7. 0.104 1.892 ↓ 1.7 628 1

Nested Loop (cost=1.27..810.22 rows=379 width=25) (actual time=0.155..1.892 rows=628 loops=1)

8. 0.015 1.374 ↑ 1.3 18 1

Nested Loop (cost=0.85..530.22 rows=23 width=25) (actual time=0.142..1.374 rows=18 loops=1)

9. 0.032 1.315 ↑ 1.2 22 1

Nested Loop (cost=0.57..520.91 rows=27 width=33) (actual time=0.095..1.315 rows=22 loops=1)

10. 0.099 0.099 ↑ 1.0 148 1

Index Scan using class_tutor_id_idx on class (cost=0.29..115.27 rows=148 width=50) (actual time=0.012..0.099 rows=148 loops=1)

  • Index Cond: ((tutor_id)::text = '5da53e1d6c52380001b553e2'::text)
11. 1.184 1.184 ↓ 0.0 0 148

Index Scan using curriculum_curriculum_id_idx on curriculum (cost=0.28..2.74 rows=1 width=33) (actual time=0.008..0.008 rows=0 loops=148)

  • Index Cond: ((curriculum_id)::text = (class.curriculum_id)::text)
  • Filter: (id = ANY ('{6068,6069,6131,6132,6137,6149,6150,6151,6152,6153,6154,6168,6235,6236,6260,6261,6262,6264,6070,6083,6133,6140,6155,6169,6170,6175,6237,6239,6263,6265,6071,6084,6134,6139,6156,6171,6176,6177,6266,6072,6085,6135,6141,6157,6158,6172,6178,6179,6233,6267,6073,6086,6136,6142,6159,6173,6182,6234,6259,6242,6268,6075,6087,6088,6167,6183,6269,6089,6079,6145,6184,6270,6077,6080,6146,6185,6246,6247,6248,6147,6186,6249,6148,6187,6250,6188,6251,6095,6189,6252,6094,6180,6253,6096,6097,6098,6099,6100,6101,6102,6103,6197,2676,5360,5363,5439,5449,5359,5448,5532,2657,5365,5362,5366,5445,5451,5574,5124,2745,6043,5341,5509,6106,6105,5364,5452,5051,5442,5440,5123,5450,4953,5361,5575,5443,5533,4377,5472,5367,5317,4450,5392,5998,5592,5525,5988,6107,5454,5052,5534,4382,5441,6108,6202,5385,5389,5577,5545,5370,5444,4381,5455,5372,5535,5382,5055,5473,4987,5390,5453,4255,5581,6109,5373,4752,5474,5257,5054,5260,5375,5578,4749,5527,5546,4256,5307,1907,6110,6206,4260,4259,5258,5579,5308,5261,5475,5376,5606,4750,5309,5053,4824,4258,6111,6207,5974,5996,5870,5476,5311,5384,5915,5985,5377,5386,5926,5259,5548,4960,6112,5842,6208,5997,5262,6019,4754,5872,5813,5067,5916,5538,5830,5994,5807,5903,5584,6059,6065,5736,5707,5874,5378,5808,5873,5854,5460,6210,5735,5597,5712,5877,5989,5204,5923,5263,4607,5313,2447,5587,5904,5976,5941,5993,5809,6114,6212,5722,5748,5803,6051,5746,5864,5749,5851,6115,6116,6213,6028,5582,5751,6009,5852,6056,5414,6214,5763,5315,5931,5762,6057,5910,2897,2650,5543,6124,6125,6215,4966,5043,5978,4994,2930,5613,5383,5345,5737,6126,5275,5356,5266,5354,5352,5488,4969,5484,4993,2685,5556,5857,4662,6128,6129,6222,5039,5489,5887,5486,5041,5743,6000,5394,2742,4278,5544,6130,4867,5557,5490,4668,5831,5821,2751,5924,4967,2755,5070,1346,6225,5620,5757,5251,5481,5572,4833,5588,5272,5072,5531,5624,6226,6010,5599,5744,6034,4980,5562,5885,5759,4669,5483,5726,5353,5297,6228,6036,5970,5494,5944,5469,2754,5271,4670,5080,5295,5492,5727,6229,5894,4665,5889,4673,5961,5861,5078,6005,5296,5949,5884,4221,5603,5404,5764,5487,5965,5292,2756,4166,5571,5249,4983,5405,5075,5930,5466,5732,5942,5530,5812,5758,5084,5849,4873,5766,5088,4808,5408,2666,5589,5936,5349,5909,5212,5729,1915,5568,4985,5963,5728,5567,5859,5391,5968,6035,5828,5073,5922,5832,5718,5411,6042,5899,4473,5605,2681,5598,5724,5274,2753,5739,5616,4973,5897,4429,5569,5773,6041,5071,6012,5964,5077,5298,5617,4666,2752,4224,6021,2587,6049,5919,5276,5267,5358,4222,4968,5956,2748,5890,5858,5992,2682,6061,5371,5725,5775,5291,4204,5860,5619,5730,5943,5911,6048,5990,5316,5708,5198,2760,5558,4672,5477,5223,5415,5776,5507,5819,5755,2302,5750,5761,5607,5720,5856,5716,5038,5094,5786,5225,5777,5508,5019,1109,5591,5398,2677,6006,4658,5774,5615,5573,5818,5711,4448,5928,5208,4299,4297,6055,5783,5827,5564,4971,5018,5880,5929,4447,5506,4782,5016,4469,5227,5510,5163,5539,5056,4659,2750,2706,5826,5420,2705,5400,6045,5946,2746,5937,5793,5790,5421,5781,5785,5021,5962,5925,5881,5918,5740,5966,5810,5714,5133,5977,5252,5742,1372,5199,5901,5717,5512,5422,5022,5782,5787,5795,2743,6037,4660,5829,4415,4671,5991,5277,5902,5511,5402,5401,5721,5273,5710,5213,5824,5862,5294,5799,2665,6002,5622,5493,6018,6031,4900,5314,5623,5979,5959,4831,5876,5369,4457,5982,5379,5403,5162,2683,5906,5423,5024,6032,5983,5853,5733,5734,5614,5796,6052,5081,5995,5122,5570,5563,5975,5083,5792,5822,6023,6064,5503,5290,5705,6033,6015,5621,5779,5601,5338,4367,2899,5868,5816,5480,5196,4866,5814,5555,5076,5794,5425,5516,5669,5233,5103,5264,5883,2679,5413,4664,5741,4874,5719,5303,6017,6007,5583,5406,5479,6003,5932,5723,4667,6060,5399,5355,5426,5798,5517,5670,5618,5478,5939,5879,5491,5020,5602,5914,5778,2664,5791,6008,5518,5427,5800,5801,5886,5017,5435,6039,5747,5986,5079,5913,5788,4414,5878,5388,6029,5802,5519,5428,5673,5672,6011,5600,5608,6040,5838,5671,4809,5715,5485,5368,2747,4640,5566,5973,6046,5981,5855,5042,5674,5520,5804,6001,5429,4965,5789,4986,5980,5987,5958,5920,5515,4974,5752,4446,5268,2749,2757,4365,5805,5521,5675,5430,5033,5387,5806,6020,5938,5867,5552,5945,5395,6014,5823,5347,5825,5871,4661,5888,5549,5470,6038,2256,5676,5431,5522,5731,2686,6013,5540,5891,5811,5972,5250,5917,5713,5780,5270,4992,5683,5680,5682,5432,5576,5505,5351,5269,4963,5999,5278,5320,5590,5784,5709,5412,5459,4902,4663,5529,4498,5433,5524,5679,5513,5760,5921,5892,5093,5424,6004,5279,5482,6062,2684,5706,5604,5882,4257,6063,5514,5434,5528,5526,5684,5437,5195,5756,4964,4972,5310,4254,5820,5060,4449,5438,2744,2590,5321,5754,5023,5905,5374,4223,6058,5410,5504,5898,6050,5753,5471,2589,5863,5554,6022,5900,5447,5350,5954,5560,5551,5971,5312,5957,5738,5348,5912,5940,5933,5797,4901}'::bigint[]))
  • Rows Removed by Filter: 1
12. 0.044 0.044 ↑ 1.0 1 22

Index Only Scan using curriculum_genre_curriculum_id_genre_idx on curriculum_genre (cost=0.28..0.33 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=22)

  • Index Cond: (curriculum_id = curriculum.id)
  • Filter: (genre = ANY ('{1,8}'::bigint[]))
  • Rows Removed by Filter: 0
  • Heap Fetches: 20
13. 0.414 0.414 ↑ 1.3 35 18

Index Scan using curriculum_record_class_id_idx on curriculum_record (cost=0.42..11.70 rows=47 width=49) (actual time=0.009..0.023 rows=35 loops=18)

  • Index Cond: ((class_id)::text = (class.class_id)::text)
  • Filter: (status = ANY ('{2,5}'::integer[]))
  • Rows Removed by Filter: 1
14. 4.396 4.396 ↑ 1.0 1 628

Index Scan using user_student_user_student_id_idx on user_student (cost=0.41..0.45 rows=1 width=33) (actual time=0.007..0.007 rows=1 loops=628)

  • Index Cond: ((user_student_id)::text = (curriculum_record.student_id)::text)
15. 0.628 0.628 ↑ 1.0 1 628

Index Scan using student_transfer_user_student_id_idx on student_transfer (cost=0.29..0.32 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=628)

  • Index Cond: (user_student_id = user_student.id)
  • Filter: (transfer_status = ANY ('{2002,1002,2003,1003,2004,1004}'::integer[]))
Planning time : 3.802 ms
Execution time : 7.636 ms