Wasteful extra project ID filtering in project scoped search
Problem
When searching for issues in a group (for example https://gitlab.com/search?utf8=%E2%9C%93&snippets=false&scope=issues&repository_ref=master&search=elasticsearch+AND+storage&group_id=9970&project_id=278964 ) we are including redundant filtered sections in the query. Only 1 of them is necessary and even it is wasteful and can be simplified.
1. Filter parent project ID and access level
This is filtering down to documents within the project and also asserting the access level is appropriate to my access of reading issues in this project.
query
{
"has_parent": {
"parent_type": "project",
"query": {
"bool": {
"should": [
{
"bool": {
"filter": [
{
"terms": {
"id": [
278964
]
}
},
{
"terms": {
"issues_access_level": [
20,
10
]
}
}
]
}
}
]
}
}
}
},
2. Searching in the parent group (I think)
This is redundant since we've already filtered down to a single project but it seems the below query is being added in error to also filter to docs that live in the parent group as either public docs or with visibility matching my access level for each project.
Query
{
"bool": {
"should": [
{
"term": {
"confidential": false
}
},
{
"bool": {
"must": [
{
"term": {
"confidential": true
}
},
{
"bool": {
"should": [
{
"term": {
"author_id": 120073
}
},
{
"term": {
"assignee_id": 120073
}
},
{
"terms": {
"project_id": [
7764,
8146,
13083,
... TRUNCATED
19899166,
19904939
]
}
}
]
}
}
]
}
}
]
}
}
Solution
We can reduce response time by more than half if we just remove (2) from the above query.
Also if it's not too difficult for the next iteration we can simplify (1) from above and we can even remove the part which checks the issues_access_level
since we should be able to know ahead of time what the issues_access_level
of this project is and immediately reject the search before even allowing an issue search if the user does not have that level of access. If we do that we'll then no longer need to use the parent join but can just use rid
directly.
Benchmarks
I benchmarked a few iterations on this query removing redundant parts piece by piece.
query1.json (current)
{
"query": {
"bool": {
"must": [
{
"simple_query_string": {
"fields": [
"title^2",
"description"
],
"query": "<QUERY>",
"default_operator": "and"
}
}
],
"filter": [
{
"term": {
"type": "issue"
}
},
{
"has_parent": {
"parent_type": "project",
"query": {
"bool": {
"should": [
{
"bool": {
"filter": [
{
"terms": {
"id": [
278964
]
}
},
{
"terms": {
"issues_access_level": [
20,
10
]
}
}
]
}
}
]
}
}
}
},
{
"bool": {
"should": [
{
"term": {
"confidential": false
}
},
{
"bool": {
"must": [
{
"term": {
"confidential": true
}
},
{
"bool": {
"should": [
{
"term": {
"author_id": 120073
}
},
{
"term": {
"assignee_id": 120073
}
},
{
"terms": {
"project_id": [
7764,
8146,
13083,
13764,
14022,
14288,
14289,
16648,
17744,
19776,
20085,
20086,
20699,
23081,
27468,
27470,
27726,
29286,
32732,
33463,
36743,
38069,
42984,
63904,
72724,
74823,
83282,
94825,
95156,
98024,
116212,
140724,
143237,
145205,
150440,
171662,
209545,
224225,
227582,
250324,
250833,
278964,
280425,
375711,
387896,
430285,
443787,
444821,
455030,
469501,
480929,
502147,
516522,
528134,
554859,
561884,
568353,
571694,
593728,
600991,
603874,
609784,
622148,
625106,
625138,
625139,
627510,
629054,
629060,
645735,
684698,
691639,
694866,
730448,
734943,
747741,
759558,
766015,
818896,
849281,
872862,
876090,
881988,
887372,
904889,
918776,
918780,
921868,
928825,
931715,
952703,
992757,
998792,
1065383,
1075159,
1075790,
1083469,
1118812,
1120019,
1128673,
1148549,
1168163,
1209837,
1216858,
1216977,
1216983,
1218848,
1219016,
1228844,
1254421,
1265999,
1272826,
1291597,
1304532,
1323671,
1329047,
1338605,
1354554,
1369728,
1379171,
1423612,
1441932,
1448997,
1449052,
1470159,
1470839,
1471537,
1481322,
1507906,
1533158,
1581015,
1639226,
1641463,
1663959,
1669267,
1680047,
1680360,
1680491,
1691340,
1693390,
1713704,
1734706,
1736366,
1750140,
1754427,
1754513,
1754872,
1755067,
1755240,
1755319,
1755398,
1755571,
1755581,
1755631,
1755701,
1755725,
1755774,
1755794,
1755813,
1755826,
1756355,
1777822,
1794617,
1796893,
1805169,
1908970,
1911766,
1935622,
1990920,
2009901,
2021503,
2093291,
2118359,
2127625,
2167959,
2197649,
2197891,
2206408,
2227454,
2249502,
2317465,
2323555,
2336542,
2337675,
2347063,
2378975,
2379580,
2382395,
2383700,
2400539,
2615225,
2641320,
2645585,
2645607,
2645621,
2645625,
2651329,
2651596,
2670515,
2694799,
2696029,
2697366,
2715353,
2715372,
2715423,
2716906,
2725567,
2729456,
2748732,
2841768,
2843592,
2860651,
2861119,
2871980,
2889669,
2890326,
2903741,
2916956,
2953390,
2959752,
3010986,
3010998,
3020050,
3035649,
3063342,
3063873,
3094319,
3101096,
3124917,
3180151,
3188754,
3195199,
3222552,
3227536,
3227611,
3230728,
3238305,
3239731,
3245116,
3248511,
3305972,
3344296,
3350893,
3357269,
3362933,
3395064,
3430480,
3466815,
3467535,
3467553,
3513163,
3536382,
3540076,
3541392,
3547210,
3555358,
3566163,
3588247,
3597914,
3601513,
3605273,
3605985,
3612384,
3626648,
3631141,
3651684,
3659483,
3662568,
3662668,
3674225,
3674569,
3692424,
3698388,
3718768,
3746386,
3760239,
3770796,
3787977,
3788751,
3825482,
3827919,
3827943,
3828396,
3842996,
3843116,
3844141,
3850566,
3871132,
3871556,
3879251,
3885956,
3885980,
3887766,
3924785,
3926041,
3933206,
3933372,
3949208,
3950829,
3980727,
3988984,
3991945,
3999840,
4037016,
4046517,
4108541,
4121724,
4126589,
4129674,
4149814,
4149988,
4151002,
4157550,
4170557,
4176070,
4186738,
4186742,
4187442,
4187996,
4198190,
4262096,
4306700,
4307813,
4341757,
4343186,
4354378,
4359271,
4382108,
4409640,
4456656,
4467622,
4492386,
4501968,
4510321,
4532466,
4533852,
4534254,
4538459,
4538809,
4540811,
4542834,
4553989,
4562632,
4564063,
4572862,
4583636,
4590643,
4594347,
4609807,
4613049,
4621046,
4621724,
4643867,
4651053,
4651840,
4655366,
4657648,
4676744,
4680889,
4685354,
4730778,
4736016,
4755645,
4775888,
4781953,
4783832,
4793514,
4814215,
4832720,
4843190,
4851467,
4869629,
4870361,
4872117,
4872211,
4872274,
4875494,
4878623,
4879867,
4885964,
4894834,
4897029,
4897210,
4902774,
4902790,
4904157,
4921652,
4949400,
4954462,
5019307,
5051657,
5059619,
5059636,
5064907,
5097604,
5149785,
5161594,
5161743,
5172723,
5191294,
5194736,
5195018,
5195275,
5230568,
5245690,
5246168,
5252782,
5260394,
5260434,
5261717,
5267777,
5279538,
5308957,
5315609,
5315709,
5330441,
5340756,
5348002,
5351075,
5373222,
5375772,
5382660,
5384965,
5385987,
5396527,
5398698,
5398935,
5408708,
5417931,
5420758,
5442890,
5444181,
5451220,
5456231,
5457651,
5457755,
5458073,
5465687,
5467143,
5467277,
5467397,
5474112,
5486671,
5498087,
5509547,
5519615,
5535856,
5542516,
5555512,
5556372,
5576532,
5580956,
5581453,
5582616,
5583759,
5591975,
5606894,
5607245,
5617895,
5630373,
5635189,
5647182,
5651817,
5677844,
5682973,
5689201,
5701388,
5702482,
5703942,
5704729,
5704746,
5727416,
5729848,
5730890,
5731755,
5737157,
5742170,
5754175,
5754302,
5761828,
5763341,
5763499,
5763665,
5763711,
5763731,
5772881,
5776166,
5777179,
5777819,
5777853,
5777918,
5777939,
5777952,
5777954,
5777976,
5778012,
5778037,
5778044,
5778056,
5778074,
5778093,
5778095,
5778802,
5778911,
5779760,
5799195,
5799533,
5828233,
5832840,
5833585,
5833601,
5833610,
5849726,
5851774,
5853396,
5855919,
5856296,
5872527,
5890024,
5892745,
5905592,
5908683,
5917435,
5945915,
5947274,
5948052,
5956309,
5956378,
5959148,
5960551,
5961798,
5962401,
5964232,
5964710,
5971285,
5971589,
5973649,
5973871,
5973936,
5976131,
5981322,
5985712,
5985998,
5989732,
5990057,
5990312,
5990542,
5994307,
5994589,
5996549,
5996987,
6006483,
6006488,
6006490,
6006491,
6006496,
6006498,
6006502,
6036839,
6043225,
6043227,
6047528,
6057676,
6085764,
6087112,
6090488,
6092883,
6092908,
6102100,
6105246,
6123459,
6124209,
6126012,
6130122,
6135689,
6142786,
6143038,
6144101,
6158323,
6168240,
6183499,
6185025,
6193233,
6205744,
6214159,
6236638,
6237085,
6237088,
6237091,
6250233,
6251062,
6271869,
6273329,
6280478,
6282913,
6292122,
6299390,
6299406,
6309715,
6310158,
6328050,
6329546,
6329603,
6329679,
6329697,
6335481,
6337030,
6337493,
6342187,
6347686,
6350287,
6350331,
6352659,
6367157,
6374580,
6374588,
6374596,
6376843,
6377472,
6379312,
6385116,
6388398,
6390880,
6392811,
6401862,
6409389,
6409831,
6412379,
6457488,
6457868,
6457917,
6458825,
6466002,
6469877,
6483575,
6487905,
6491312,
6491770,
6493936,
6518758,
6522009,
6523803,
6523862,
6527636,
6527883,
6528905,
6529051,
6529992,
6532260,
6535935,
6537150,
6539529,
6543226,
6549389,
6551834,
6562560,
6563727,
6564143,
6566594,
6621605,
6700625,
6739512,
6802300,
6841833,
6898170,
6899799,
6900564,
6938270,
6967269,
6969397,
7045471,
7064865,
7071043,
7071551,
7083173,
7089919,
7094307,
7094355,
7094598,
7143213,
7145793,
7147372,
7173332,
7174401,
7177575,
7179018,
7227934,
7229994,
7243435,
7243691,
7243725,
7261310,
7262047,
7265573,
7268729,
7296227,
7341167,
7343341,
7415201,
7418168,
7419115,
7422946,
7424125,
7424718,
7433222,
7444580,
7444821,
7448582,
7453181,
7459001,
7462965,
7480317,
7506017,
7507938,
7523614,
7524061,
7527683,
7533703,
7540679,
7542725,
7544403,
7552429,
7559166,
7560116,
7560137,
7572102,
7572488,
7599316,
7602162,
7612864,
7633177,
7650596,
7657963,
7660210,
7660893,
7682093,
7684276,
7686095,
7688358,
7692253,
7702814,
7710897,
7710917,
7710952,
7710970,
7720277,
7721578,
7724576,
7728548,
7728573,
7728666,
7745145,
7750063,
7750843,
7776928,
7778254,
7792567,
7795571,
7805316,
7815055,
7816336,
7844502,
7897930,
7898246,
7899038,
7926410,
7926806,
7927221,
7937396,
7951712,
7955704,
7963964,
7969682,
7981954,
7982888,
8010034,
8014447,
8023964,
8028955,
8034269,
8057910,
8088807,
8093013,
8107505,
8134589,
8205878,
8223987,
8226179,
8230544,
8234858,
8241235,
8242077,
8242705,
8254331,
8258778,
8260174,
8261461,
8262564,
8263983,
8275990,
8280241,
8311214,
8313070,
8316996,
8320404,
8332212,
8332426,
8332899,
8336425,
8343284,
8354595,
8362868,
8364708,
8365294,
8368324,
8368695,
8368700,
8375261,
8377576,
8388559,
8394693,
8414316,
8419203,
8420921,
8423883,
8425729,
8427052,
8433603,
8434190,
8434778,
8435407,
8435569,
8435604,
8438681,
8445354,
8446918,
8462766,
8463336,
8472337,
8479038,
8497366,
8507269,
8536840,
8548321,
8575411,
8578722,
8583402,
8586659,
8592243,
8597083,
8600463,
8607795,
8621082,
8661839,
8664252,
8664254,
8665614,
8665829,
8667406,
8669807,
8671969,
8680333,
8684637,
8690216,
8723928,
8730668,
8748907,
8749019,
8761790,
8764292,
8768313,
8785473,
8792066,
8801643,
8813470,
8813524,
8815575,
8829235,
8873767,
8873781,
8891243,
8898759,
8905753,
8914499,
8914599,
8914775,
8918950,
8935478,
8946851,
8949995,
8953481,
8954499,
8956177,
8971611,
8987255,
8995153,
9013825,
9014348,
9023126,
9029785,
9032195,
9045270,
9049889,
9051436,
9051829,
9056740,
9060218,
9067962,
9073579,
9076311,
9076918,
9109988,
9110518,
9110601,
9110645,
9111142,
9114482,
9116367,
9120954,
9125567,
9134345,
9139124,
9148954,
9149724,
9151614,
9162123,
9165762,
9169846,
9172421,
9172481,
9181808,
9182120,
9182498,
9184461,
9184510,
9185208,
9187032,
9193423,
9201021,
9206868,
9209370,
9222575,
9223256,
9223291,
9226308,
9226772,
9237774,
9238269,
9240803,
9241488,
9241904,
9242936,
9262811,
9264071,
9264380,
9264931,
9264999,
9265182,
9270697,
9277726,
9281155,
9285791,
9286511,
9287676,
9292804,
9307128,
9307188,
9308076,
9353893,
9358979,
9359704,
9359710,
9366867,
9378038,
9383040,
9396716,
9435654,
9438583,
9438997,
9442428,
9450192,
9450195,
9450197,
9492132,
9497089,
9506180,
9512788,
9513004,
9538485,
9552115,
9556660,
9577098,
9628392,
9628760,
9628831,
9638595,
9641540,
9663108,
9663122,
9683602,
9688434,
9690943,
9712018,
9737459,
9753184,
9762266,
9780400,
9815552,
9819772,
9820038,
9820655,
9820715,
9820722,
9820741,
9820753,
9820762,
9820824,
9820827,
9820828,
9820831,
9820833,
9820839,
9820841,
9820844,
9820851,
9821951,
9858217,
9870184,
9890662,
9892691,
9906426,
9906696,
9911211,
9916677,
9922412,
9927571,
9928781,
9946058,
9946302,
9972147,
9986071,
10005404,
10014839,
10019169,
10024275,
10069011,
10071001,
10071132,
10101821,
10189997,
10206141,
10213373,
10235167,
10246946,
10248422,
10250108,
10252557,
10261721,
10265998,
10268953,
10270402,
10271072,
10271508,
10275489,
10276290,
10283237,
10285070,
10286775,
10286983,
10287391,
10290471,
10293836,
10300932,
10304488,
10323786,
10323852,
10326386,
10364187,
10372446,
10373272,
10377636,
10380563,
10381594,
10384892,
10388981,
10389877,
10397437,
10400718,
10412940,
10414983,
10417418,
10424695,
10431003,
10432753,
10434214,
10437244,
10464115,
10465597,
10467654,
10471392,
10472408,
10476326,
10498238,
10506825,
10514153,
10523039,
10523991,
10524335,
10535883,
10537904,
10537984,
10540294,
10540385,
10566271,
10570658,
10574281,
10577491,
10579950,
10581498,
10581507,
10586771,
10589251,
10595312,
10602600,
10613135,
10614162,
10618711,
10619765,
10633620,
10634836,
10648099,
10649094,
10649850,
10649895,
10652513,
10652597,
10672540,
10680791,
10682684,
10686828,
10690250,
10701264,
10705656,
10705729,
10718171,
10726650,
10736075,
10736142,
10740762,
10740918,
10740982,
10741243,
10742462,
10743062,
10744086,
10745354,
10745562,
10747057,
10748426,
10753211,
10760227,
10785141,
10786772,
10787150,
10789684,
10790096,
10790816,
10804662,
10806856,
10807232,
10811417,
10812651,
10818356,
10820774,
10828791,
10832326,
10833541,
10846534,
10846938,
10846951,
10861561,
10863414,
10891199,
10900398,
10905003,
10920828,
10924899,
10927751,
10938268,
10942385,
10946797,
10947320,
10947578,
10948374,
10948395,
10948418,
10953870,
10956869,
10960507,
10970818,
10970901,
10973541,
10976748,
10980372,
10981605,
10982204,
10982216,
10982227,
10987682,
10987687,
10987692,
10994780,
11001065,
11001094,
11002691,
11002707,
11015994,
11041435,
11046863,
11046872,
11047304,
11047485,
11047497,
11047509,
11047518,
11047532,
11047547,
11047561,
11047569,
11047577,
11047583,
11047595,
11047612,
11048024,
11058460,
11066077,
11067315,
11080193,
11087662,
11087666,
11087679,
11087693,
11096787,
11099127,
11103764,
11139665,
11139673,
11139991,
11141467,
11143318,
11144774,
11144823,
11146000,
11154154,
11154787,
11156954,
11159135,
11160045,
11164718,
11166340,
11168980,
11173751,
11173894,
11177166,
11177761,
11178474,
11181572,
11183293,
11193532,
11195075,
11196060,
11199216,
11203076,
11203150,
11207576,
11209315,
11215620,
11226276,
11229385,
11250294,
11261137,
11263648,
11263747,
11264434,
11272504,
11281547,
11286212,
11287450,
11288585,
11289813,
11303534,
11310488,
11316755,
11317028,
11317506,
11322136,
11322971,
11323927,
11324502,
11330541,
11346840,
11362613,
11365423,
11371836,
11373038,
11374980,
11380952,
11385144,
11387486,
11391191,
11392563,
11392982,
11412702,
11417170,
11417438,
11418948,
11423962,
11424180,
11427612,
11428501,
11432834,
11435574,
11435628,
11436541,
11446522,
11446790,
11449672,
11472241,
11485253,
11498238,
11506764,
11511606,
11513923,
11519032,
11520423,
11524481,
11533294,
11548261,
11557431,
11559410,
11560923,
11571016,
11574953,
11576963,
11588554,
11607069,
11611855,
11616932,
11618468,
11625232,
11626101,
11632258,
11641198,
11641757,
11643501,
11647110,
11659535,
11662638,
11664000,
11664805,
11676871,
11680396,
11682097,
11682851,
11682866,
11686753,
11687257,
11688089,
11690558,
11691075,
11694671,
11699191,
11699207,
11699772,
11701860,
11745002,
11746865,
11750216,
11750578,
11750632,
11750662,
11758081,
11758351,
11767955,
11769032,
11772138,
11774751,
11774967,
11794675,
11797129,
11810535,
11826878,
11826928,
11827203,
11827231,
11830702,
11830706,
11831587,
11862828,
11863369,
11868033,
11869481,
11869718,
11871414,
11873261,
11880131,
11884750,
11890867,
11895900,
11897079,
11906009,
11909903,
11915984,
11924442,
11924556,
11925674,
11925677,
11925682,
11925685,
11925689,
11925692,
11925695,
11925697,
11925699,
11925701,
11925704,
11925705,
11925708,
11925710,
11925713,
11927177,
11929173,
11929229,
11940271,
11941429,
11941857,
11943384,
11943529,
11945639,
11945665,
11964114,
11965174,
11968429,
11977160,
11978709,
11994835,
11997420,
12006272,
12009138,
12015396,
12016752,
12016856,
12017781,
12019773,
12019779,
12019783,
12019799,
12019856,
12019859,
12019872,
12019977,
12031470,
12034772,
12042493,
12047412,
12047525,
12049441,
12051231,
12051824,
12075545,
12080739,
12088168,
12089274,
12092124,
12100818,
12102692,
12104213,
12106293,
12118095,
12121565,
12127977,
12130048,
12130637,
12132487,
12138544,
12138631,
12138769,
12140428,
12140919,
12141341,
12143319,
12144637,
12148435,
12156688,
12156707,
12157132,
12157469,
12157484,
12157566,
12169106,
12193672,
12193723,
12198018,
12199426,
12207295,
12212610,
12216821,
12219374,
12224474,
12233892,
12258085,
12261137,
12267315,
12270872,
12271982,
12271993,
12271995,
12271997,
12272000,
12272001,
12272002,
12272003,
12272004,
12272005,
12272006,
12272007,
12272008,
12272009,
12272010,
12272011,
12272012,
12272014,
12272015,
12272016,
12272018,
12272019,
12272024,
12272025,
12272030,
12272032,
12272036,
12272040,
12272049,
12272051,
12272053,
12272056,
12272064,
12272066,
12272071,
12272093,
12272095,
12272119,
12272164,
12272174,
12272200,
12272370,
12272477,
12272586,
12272605,
12273972,
12273973,
12273975,
12273978,
12273983,
12273988,
12273995,
12273999,
12274019,
12274036,
12274047,
12274048,
12274049,
12274053,
12274058,
12274059,
12274061,
12274062,
12274065,
12274066,
12274067,
12274068,
12274070,
12274076,
12274078,
12274079,
12274081,
12274089,
12274094,
12274099,
12274104,
12274109,
12274122,
12274127,
12274139,
12274166,
12274192,
12274200,
12274218,
12274295,
12274595,
12295093,
12310918,
12312972,
12324531,
12324627,
12329035,
12332463,
12333288,
12346133,
12348598,
12359543,
12365035,
12367031,
12368432,
12369404,
12374406,
12384674,
12384724,
12384780,
12388345,
12388739,
12389964,
12394217,
12398410,
12414547,
12419177,
12423627,
12425329,
12425391,
12427941,
12431769,
12432257,
12446167,
12448243,
12449861,
12450055,
12450807,
12450931,
12452095,
12452280,
12461476,
12463116,
12465266,
12466327,
12466351,
12468120,
12472977,
12477069,
12477114,
12483816,
12489473,
12490793,
12499117,
12500922,
12507547,
12509066,
12510689,
12511885,
12533806,
12547113,
12551742,
12556850,
12558964,
12570569,
12571797,
12579833,
12583903,
12586196,
12595709,
12605958,
12605998,
12605999,
12609591,
12609592,
12615516,
12622050,
12627004,
12632420,
12637850,
12677425,
12677536,
12678393,
12679709,
12679942,
12682842,
12683499,
12685789,
12690061,
12692613,
12695049,
12695730,
12698292,
12699068,
12699733,
12701325,
12701351,
12701385,
12701393,
12707329,
12712206,
12712318,
12713313,
12715184,
12720446,
12721412,
12724255,
12730750,
12734179,
12734322,
12739222,
12739541,
12745894,
12748104,
12749207,
12749232,
12749795,
12778249,
12779103,
12779738,
12785759,
12787250,
12794378,
12794484,
12795157,
12801140,
12807631,
12809231,
12811526,
12812054,
12820343,
12821249,
12823951,
12825908,
12826098,
12826661,
12826675,
12827679,
12828695,
12832358,
12833683,
12840474,
12844271,
12844708,
12844789,
12846743,
12855508,
12860702,
12865970,
12866476,
12869345,
12891905,
12898518,
12901727,
12903469,
12905700,
12906691,
12908711,
12910060,
12921549,
12921572,
12924436,
12928687,
12929309,
12934186,
12939133,
12941957,
12942881,
12946842,
12950913,
12959103,
12959999,
12962252,
12962498,
12967878,
12968105,
12968493,
12970157,
12972827,
12977241,
12977260,
12978787,
12988591,
13010446,
13013273,
13015257,
13015884,
13017012,
13017629,
13017904,
13017938,
13017951,
13017970,
13017973,
13017990,
13018004,
13018017,
13018997,
13019130,
13019310,
13021417,
13028865,
13029725,
13030560,
13031161,
13033489,
13034024,
13035093,
13036793,
13036901,
13048185,
13048214,
13049223,
13049308,
13049819,
13053017,
13055361,
13063879,
13064599,
13071951,
13076567,
13078775,
13079377,
13081192,
13081440,
13084505,
13085638,
13086447,
13122088,
13124561,
13129295,
13130853,
13142177,
13142201,
13146936,
13150952,
13154619,
13156037,
13159042,
13170322,
13175014,
13175116,
13175755,
13177667,
13179064,
13189138,
13191740,
13199069,
13199089,
13211136,
13214602,
13221781,
13227521,
13240222,
13245650,
13249059,
13255870,
13258629,
13259161,
13259947,
13260099,
13261560,
13267593,
13275545,
13278584,
13284652,
13288318,
13289645,
13289980,
13291427,
13291940,
13293136,
13293594,
13293785,
13314274,
13314418,
13327609,
13327671,
13331704,
13335997,
13336372,
13340285,
13340484,
13348998,
13351175,
13353940,
13356639,
13357354,
13362575,
13363506,
13363600,
13365885,
13367491,
13368043,
13371193,
13378563,
13380785,
13385385,
13393057,
13399215,
13403060,
13420788,
13425895,
13427879,
13428570,
13432059,
13432737,
13437682,
13438627,
13439222,
13440537,
13440705,
13440751,
13440799,
13440821,
13440851,
13440859,
13440880,
13440891,
13440898,
13440910,
13445876,
13451957,
13453461,
13454093,
13455802,
13467157,
13473687,
13473820,
13490286,
13491707,
13500111,
13507768,
13507881,
13509075,
13513194,
13534522,
13537679,
13546990,
13548870,
13549696,
13551762,
13555549,
13556951,
13561459,
13566613,
13567507,
13569049,
13569116,
13571166,
13571194,
13574877,
13575368,
13584096,
13585705,
13586863,
13588335,
13589474,
13589490,
13590021,
13594770,
13596782,
13608636,
13608790,
13609940,
13611569,
13612271,
13613417,
13621961,
13622801,
13626558,
13662039,
13663230,
13663986,
13664986,
13665065,
13665917,
13667826,
13672316,
13672681,
13673582,
13673632,
13673686,
13673757,
13673908,
13673934,
13674085,
13674136,
13675927,
13675979,
13676002,
13676032,
13676096,
13676142,
13676188,
13676249,
13676309,
13676350,
13680947,
13681546,
13682007,
13682597,
13683615,
13683636,
13690327,
13740954,
13742636,
13743964,
13755592,
13776562,
13791634,
13792693,
13797347,
13797543,
13798059,
13798547,
13807012,
13814866,
13814897,
13815382,
13815397,
13815806,
13818071,
13822214,
13823180,
13824926,
13831684,
13837631,
13837751,
13837772,
13839721,
13842214,
13842876,
13844856,
13844901,
13845065,
13848195,
13850886,
13853206,
13858209,
13864564,
13877511,
13883633,
13885318,
13885623,
13888931,
13889908,
13889984,
13890316,
13899453,
13902507,
13905629,
13907033,
13908023,
13908470,
13915995,
13919366,
13922331,
13923423,
13924477,
13925914,
13927729,
13932235,
13936492,
13936656,
13941092,
13942461,
13944900,
13945012,
13945084,
13945216,
13945260,
13949677,
13949837,
13952052,
13954053,
13958846,
13960285,
13960749,
13961293,
13992166,
13992565,
13997108,
13997769,
13999595,
14002901,
14002930,
14003042,
14009012,
14013332,
14015286,
14016835,
14018700,
14022579,
14025060,
14025202,
14031541,
14031692,
14032317,
14032757,
14033281,
14034452,
14037797,
14049995,
14050386,
14055797,
14056270,
14056289,
14069430,
14069806,
14070115,
14071012,
14071101,
14072702,
14092502,
14097509,
14103944,
14110257,
14116778,
14120477,
14122546,
14122625,
14123181,
14123810,
14124514,
14125595,
14127584,
14130725,
14131869,
14131963,
14132361,
14135327,
14145349,
14146123,
14146539,
14146952,
14153970,
14154117,
14154272,
14155648,
14158369,
14160652,
14163506,
14165815,
14166967,
14167564,
14171783,
14172927,
14173555,
14177465,
14181670,
14184456,
14209305,
14213315,
14213347,
14213859,
14213955,
14214595,
14217204,
14218505,
14220389,
14225824,
14228671,
14228691,
14230440,
14231319,
14235406,
14235835,
14238199,
14240586,
14240985,
14242200,
14243565,
14255668,
14256817,
14261932,
14262949,
14263471,
14264161,
14274989,
14275714,
14280258,
14280423,
14281382,
14281780,
14282394,
14282697,
14287799,
14289598,
14290884,
14292404,
14295515,
14299231,
14299918,
14312391,
14328903,
14329271,
14329819,
14335150,
14335400,
14339482,
14339627,
14343602,
14344510,
14345536,
14356474,
14359446,
14359466,
14360568,
14360816,
14361700,
14366689,
14372596,
14374007,
14378183,
14378266,
14378900,
14378988,
14380351,
14392833,
14393176,
14395940,
14397777,
14399034,
14399476,
14401445,
14402240,
14402567,
14404482,
14404642,
14407984,
14410926,
14421707,
14423523,
14423527,
14423537,
14438254,
14442567,
14443718,
14446830,
14450137,
14456724,
14460316,
14460969,
14463198,
14466515,
14469046,
14473903,
14474427,
14477200,
14477352,
14480238,
14482655,
14482702,
14482780,
14482782,
14482798,
14482856,
14492538,
14492844,
14497178,
14497299,
14503868,
14514713,
14516482,
14519429,
14520336,
14520808,
14520827,
14521142,
14523743,
14524096,
14525770,
14527914,
14531104,
14531370,
14534232,
14537581,
14539436,
14540554,
14540610,
14547605,
14553312,
14556228,
14577419,
14578457,
14579026,
14579130,
14579403,
14582758,
14586173,
14587320,
14588374,
14590722,
14592901,
14593048,
14594493,
14596172,
14597569,
14599888,
14603699,
14609346,
14609680,
14612673,
14613999,
14614147,
14614156,
14614249,
14616867,
14617125,
14618740,
14622440,
14630071,
14633853,
14637026,
14639182,
14640333,
14640358,
14642095,
14645774,
14645818,
14646067,
14646402,
14651937,
14654662,
14655591,
14676946,
14685445,
14687382,
14694517,
14694609,
14701841,
14706244,
14707715,
14709082,
14716222,
14717274,
14717778,
14718788,
14720460,
14720558,
14720629,
14720678,
14725706,
14735100,
14735158,
14737865,
14747806,
14756912,
14757510,
14761315,
14764291,
14767805,
14768731,
14771920,
14774092,
14778692,
14780934,
14785608,
14802295,
14804554,
14810991,
14821022,
14822788,
14824410,
14825638,
14832303,
14834748,
14834815,
14834881,
14836665,
14837578,
14840095,
14844851,
14847746,
14849194,
14850988,
14853550,
14856495,
14857425,
14858952,
14860295,
14861036,
14872396,
14877035,
14877155,
14878998,
14882234,
14888592,
14893314,
14896592,
14896627,
14896784,
14896810,
14897009,
14897263,
14913538,
14921629,
14927309,
14941048,
14959904,
14961310,
14978605,
14983046,
14984608,
14986068,
14986146,
14986497,
14994875,
14997776,
15001861,
15002737,
15003550,
15003795,
15005851,
15011390,
15014435,
15019155,
15019630,
15032634,
15056583,
15058366,
15065439,
15078021,
15078033,
15078246,
15085791,
15088361,
15097062,
15097974,
15098265,
15098966,
15101703,
15110726,
15112583,
15112970,
15113979,
15114395,
15114652,
15118216,
15126090,
15126989,
15129171,
15129591,
15129822,
15131420,
15131807,
15132803,
15156822,
15157797,
15157964,
15158038,
15161313,
15168807,
15170865,
15173002,
15173073,
15173346,
15174272,
15174997,
15180673,
15182494,
15189796,
15191816,
15191824,
15192330,
15192493,
15192656,
15193240,
15193397,
15194300,
15198093,
15205862,
15206937,
15207036,
15208716,
15208888,
15209594,
15210340,
15212932,
15220559,
15224328,
15224357,
15224366,
15229382,
15232184,
15234689,
15236096,
15238903,
15240903,
15245985,
15246838,
15251533,
15252595,
15252993,
15254257,
15284973,
15289033,
15289042,
15289094,
15290709,
15291320,
15294241,
15294395,
15294489,
15294911,
15295192,
15297693,
15300655,
15305920,
15310444,
15313886,
15315691,
15316602,
15318288,
15318923,
15321464,
15321907,
15326875,
15330699,
15332361,
15332627,
15332747,
15333075,
15333630,
15334170,
15335312,
15336717,
15342429,
15343832,
15344932,
15348188,
15349792,
15351132,
15351295,
15356080,
15356098,
15357529,
15358301,
15362143,
15363819,
15364225,
15368236,
15369510,
15369706,
15369898,
15370824,
15392993,
15393051,
15405439,
15405471,
15412762,
15414093,
15417273,
15419461,
15420077,
15424908,
15424984,
15425029,
15426333,
15429560,
15432815,
15442808,
15445353,
15445402,
15445883,
15446192,
15446227,
15447439,
15447440,
15451795,
15459951,
15461649,
15463529,
15463539,
15465707,
15467852,
15476717,
15477483,
15486630,
15488074,
15488130,
15499604,
15499610,
15499832,
15502498,
15516315,
15524033,
15525618,
15527727,
15533296,
15536390,
15539826,
15544349,
15544438,
15549569,
15550662,
15552386,
15570266,
15571373,
15572444,
15584590,
15584746,
15598153,
15602116,
15606225,
15608930,
15617720,
15619150,
15619164,
15625643,
15626756,
15631043,
15631115,
15634131,
15634437,
15635773,
15636047,
15636203,
15636362,
15639109,
15639922,
15639980,
15640524,
15640743,
15640747,
15641372,
15641417,
15641546,
15642024,
15642025,
15642544,
15654404,
15659802,
15662771,
15664470,
15665075,
15667093,
15667739,
15671829,
15677708,
15682513,
15683922,
15685261,
15685819,
15685887,
15685912,
15687385,
15687464,
15703349,
15704133,
15704782,
15705998,
15710157,
15710326,
15712738,
15720150,
15721453,
15723761,
15723775,
15724796,
15729992,
15730380,
15730721,
15754157,
15754539,
15763349,
15769471,
15769622,
15769659,
15774846,
15776721,
15778605,
15785016,
15787276,
15799951,
15801195,
15803419,
15805806,
15808185,
15808924,
15815706,
15816248,
15820511,
15821588,
15822964,
15823793,
15828516,
15830549,
15833535,
15834619,
15835166,
15836196,
15837787,
15841525,
15841984,
15844807,
15854396,
15854412,
15855115,
15856598,
15861607,
15864461,
15864543,
15866088,
15866435,
15875037,
15883771,
15887375,
15897937,
15898398,
15900764,
15902203,
15904121,
15904902,
15911298,
15923007,
15925378,
15926775,
15927961,
15928582,
15940277,
15943672,
15944022,
15953320,
15956928,
15957249,
15958906,
15959935,
15962657,
15966621,
15969791,
15976861,
15979997,
16006233,
16007380,
16007726,
16009198,
16012220,
16032271,
16061215,
16062843,
16091132,
16110032,
16113690,
16114278,
16120416,
16130970,
16139144,
16141801,
16144588,
16148655,
16155201,
16159430,
16162288,
16172209,
16174388,
16178532,
16180648,
16181442,
16181728,
16203349,
16204730,
16204942,
16205104,
16218857,
16219659,
16223853,
16227592,
16231726,
16233736,
16234938,
16236843,
16238302,
16239404,
16240466,
16240616,
16241023,
16241416,
16241963,
16247504,
16250841,
16254470,
16254621,
16254950,
16255009,
16255482,
16255505,
16255558,
16255753,
16255882,
16257114,
16257894,
16258220,
16258489,
16259338,
16263963,
16280335,
16288111,
16293429,
16293937,
16294172,
16297627,
16298222,
16298313,
16299694,
16300791,
16301318,
16302012,
16302582,
16302611,
16302677,
16302746,
16302856,
16310947,
16311413,
16314030,
16315570,
16320961,
16323629,
16323838,
16324003,
16333535,
16342665,
16342741,
16342823,
16347120,
16349381,
16356945,
16357591,
16362102,
16362800,
16366321,
16366354,
16371021,
16372330,
16373815,
16375491,
16376101,
16376152,
16376777,
16377471,
16377802,
16379995,
16382083,
16385790,
16406773,
16408593,
16417655,
16417706,
16417829,
16420172,
16420592,
16423398,
16424606,
16435635,
16441509,
16441615,
16447150,
16451758,
16464769,
16466244,
16470734,
16477105,
16488249,
16488875,
16489560,
16491487,
16492321,
16493787,
16494175,
16494314,
16494327,
16494585,
16499744,
16500980,
16500999,
16501019,
16501038,
16501163,
16501176,
16501697,
16503752,
16505341,
16505542,
16507839,
16512407,
16513043,
16526009,
16549277,
16549388,
16550056,
16550165,
16552062,
16553083,
16553209,
16553464,
16553479,
16554033,
16573099,
16575006,
16575133,
16576112,
16590122,
16592857,
16595494,
16595792,
16597011,
16597098,
16603968,
16606606,
16607739,
16610235,
16611943,
16611981,
16613287,
16613296,
16617181,
16622651,
16627345,
16629675,
16630809,
16660123,
16665347,
16669052,
16669214,
16669352,
16672415,
16676292,
16679893,
16683102,
16686549,
16694332,
16696524,
16697534,
16697555,
16698323,
16700143,
16700959,
16703826,
16706505,
16706750,
16707070,
16708261,
16708329,
16708381,
16712149,
16713105,
16715764,
16716123,
16719973,
16723017,
16724049,
16724407,
16725311,
16725376,
16725860,
16726263,
16727818,
16732333,
16739750,
16743024,
16744176,
16744329,
16747681,
16749340,
16751979,
16756957,
16764170,
16765714,
16766943,
16814297,
16816732,
16817350,
16819118,
16819125,
16819131,
16819134,
16819140,
16819151,
16819248,
16838575,
16842968,
16843711,
16846956,
16848375,
16852014,
16858795,
16859491,
16859857,
16863027,
16868354,
16873105,
16873326,
16875058,
16876014,
16881303,
16881751,
16883353,
16889695,
16895122,
16897315,
16899678,
16911887,
16913647,
16914810,
16918080,
16936056,
16948601,
16950939,
16958193,
16973080,
16975552,
16983452,
16987690,
16988196,
16988604,
16989011,
16989661,
16989770,
16990137,
16991951,
16992604,
16992611,
16994074,
16995541,
16996444,
16996536,
17002973,
17007479,
17008190,
17008590,
17010239,
17011586,
17015262,
17017679,
17018542,
17019611,
17022380,
17023897,
17030279,
17031626,
17032017,
17034660,
17035255,
17039597,
17039657,
17042390,
17042700,
17043690,
17045008,
17050975,
17053607,
17053917,
17054813,
17058199,
17062429,
17066025,
17085265,
17091471,
17093611,
17093632,
17095519,
17096839,
17102568,
17103330,
17104945,
17105087,
17105719,
17108168,
17113313,
17120026,
17120503,
17128091,
17130955,
17133301,
17133307,
17134833,
17136273,
17147389,
17148146,
17151173,
17151529,
17158002,
17158018,
17158078,
17158085,
17158098,
17159976,
17166102,
17167943,
17169260,
17170889,
17172124,
17172530,
17175031,
17175153,
17175774,
17176347,
17176376,
17177253,
17177275,
17179147,
17180700,
17181705,
17184272,
17188877,
17190511,
17192788,
17192985,
17198855,
17210811,
17220339,
17230959,
17237218,
17238939,
17242983,
17244357,
17245095,
17246976,
17253120,
17253139,
17253748,
17253921,
17254286,
17254483,
17254672,
17254996,
17257555,
17261226,
17262442,
17265840,
17267470,
17268838,
17271570,
17281958,
17283679,
17284819,
17286929,
17288681,
17289065,
17289521,
17291125,
17311004,
17313817,
17314645,
17318793,
17322620,
17325482,
17330724,
17333558,
17334694,
17335983,
17345914,
17363961,
17370206,
17370850,
17370917,
17371314,
17372321,
17373998,
17375085,
17375753,
17376539,
17377115,
17377171,
17377288,
17385201,
17385356,
17385768,
17392353,
17392564,
17394238,
17396302,
17397889,
17400651,
17400812,
17402056,
17407684,
17407852,
17407981,
17410444,
17417525,
17421565,
17422490,
17423957,
17429946,
17433833,
17433838,
17445582,
17445621,
17446351,
17448458,
17449870,
17450826,
17453432,
17455616,
17458174,
17458273,
17462807,
17471714,
17472864,
17473388,
17473715,
17475441,
17475989,
17515710,
17521794,
17522813,
17523881,
17529261,
17530059,
17540835,
17544843,
17544890,
17544965,
17545029,
17545989,
17546218,
17546673,
17547037,
17547607,
17549636,
17550212,
17558274,
17563966,
17565369,
17565585,
17566360,
17570970,
17584993,
17587964,
17588121,
17588450,
17590880,
17593208,
17594660,
17596052,
17597242,
17597342,
17599029,
17599543,
17600889,
17603886,
17607801,
17608572,
17611425,
17612477,
17616536,
17617432,
17626838,
17656400,
17657269,
17657301,
17659687,
17660374,
17661412,
17661947,
17662019,
17662208,
17663350,
17665830,
17668435,
17683601,
17688145,
17689652,
17693987,
17696437,
17696876,
17697352,
17700724,
17712447,
17713741,
17716992,
17717716,
17719500,
17719928,
17720083,
17720205,
17721598,
17727093,
17730216,
17732856,
17735787,
17738687,
17743501,
17747896,
17750093,
17750950,
17751255,
17753367,
17753565,
17754555,
17762739,
17763431,
17798751,
17802074,
17814501,
17816049,
17816825,
17821569,
17823896,
17827727,
17830319,
17832310,
17833023,
17834413,
17837165,
17838225,
17842971,
17843116,
17850635,
17852402,
17859886,
17861913,
17863546,
17867837,
17869571,
17875927,
17877853,
17882005,
17885954,
17886587,
17888120,
17888613,
17889068,
17890609,
17891377,
17892568,
17894042,
17894202,
17894506,
17895630,
17901390,
17904777,
17908489,
17910217,
17912666,
17912832,
17930014,
17956638,
17958859,
17960068,
17960932,
17963040,
17963827,
17964563,
17966464,
17967450,
17967459,
17968643,
17968920,
17971433,
17974299,
17976848,
17978213,
17980663,
17982242,
17985459,
17986680,
17987891,
17988945,
17990319,
17992812,
17993150,
17993761,
17994706,
18000453,
18003142,
18006606,
18008830,
18011059,
18012606,
18013494,
18013590,
18013642,
18013733,
18013880,
18015528,
18017579,
18021647,
18026144,
18026425,
18026636,
18033116,
18036535,
18041434,
18042963,
18056643,
18060235,
18060348,
18066830,
18070909,
18095296,
18102165,
18107757,
18108985,
18109311,
18109408,
18110356,
18112416,
18113582,
18127707,
18127987,
18134677,
18135540,
18140840,
18144314,
18147276,
18147374,
18147399,
18153785,
18154934,
18154938,
18156681,
18157270,
18157383,
18160374,
18161274,
18161417,
18161527,
18161538,
18161545,
18161552,
18161560,
18161571,
18161573,
18161599,
18161625,
18161634,
18161649,
18161790,
18163072,
18163099,
18171162,
18173536,
18176831,
18178990,
18179066,
18179521,
18179550,
18180419,
18180596,
18181423,
18185408,
18191490,
18193620,
18200485,
18200533,
18201472,
18205375,
18208929,
18242419,
18250019,
18251471,
18252419,
18255806,
18255819,
18256098,
18256121,
18256125,
18256369,
18256375,
18256379,
18256394,
18257029,
18262033,
18266508,
18270782,
18281119,
18283024,
18283598,
18283646,
18284159,
18284199,
18287416,
18293273,
18298876,
18305763,
18307351,
18307741,
18307889,
18308312,
18308374,
18310801,
18313773,
18315938,
18320902,
18321485,
18328001,
18331927,
18335684,
18336216,
18340261,
18342819,
18342969,
18346158,
18347703,
18347716,
18347753,
18347757,
18347776,
18347780,
18347796,
18347808,
18347809,
18347819,
18347820,
18347830,
18347831,
18347833,
18347834,
18347835,
18347836,
18347837,
18347844,
18347848,
18347863,
18347890,
18347935,
18347953,
18348379,
18348449,
18367810,
18374998,
18392027,
18406509,
18439881,
18441720,
18442640,
18443821,
18446184,
18449638,
18449722,
18449765,
18449783,
18450203,
18451745,
18455867,
18460165,
18460362,
18462001,
18462060,
18464659,
18464813,
18466096,
18468708,
18473300,
18475044,
18480370,
18486295,
18488032,
18489477,
18491568,
18492029,
18492157,
18503012,
18505515,
18513166,
18521494,
18567237,
18578096,
18578251,
18578873,
18578899,
18579216,
18579502,
18579922,
18580038,
18580320,
18586751,
18593600,
18594323,
18594390,
18599591,
18601508,
18603722,
18604470,
18606289,
18622629,
18625712,
18629149,
18630980,
18635274,
18637792,
18639014,
18641703,
18645650,
18649977,
18650319,
18650560,
18654462,
18663049,
18666842,
18668507,
18671051,
18671058,
18671075,
18672603,
18699083,
18699991,
18703676,
18707738,
18708719,
18710973,
18716754,
18719477,
18719631,
18719654,
18727459,
18729341,
18734957,
18738619,
18741849,
18741880,
18742000,
18744517,
18745209,
18746162,
18746830,
18748948,
18749297,
18757018,
18757565,
18757830,
18757987,
18758149,
18759590,
18759998,
18760252,
18760448,
18761669,
18761763,
18762555,
18764278,
18765091,
18766720,
18766749,
18770944,
18776133,
18776356,
18783892,
18784744,
18786611,
18789638,
18790288,
18791999,
18792504,
18802609,
18808141,
18808529,
18810004,
18824670,
18837720,
18844883,
18847064,
18847201,
18848152,
18849066,
18855526,
18855845,
18855948,
18855989,
18856489,
18860383,
18861709,
18863350,
18867949,
18874917,
18875792,
18877301,
18877555,
18880248,
18882871,
18889188,
18890126,
18893322,
18897384,
18897464,
18897919,
18899486,
18899500,
18904005,
18904096,
18905432,
18908974,
18912365,
18912401,
18912515,
18912797,
18912875,
18912995,
18913021,
18913124,
18913156,
18917761,
18919133,
18920522,
18920896,
18920956,
18922068,
18922355,
18922546,
18922621,
18925373,
18935591,
18938463,
18941629,
18942856,
18942862,
18943183,
18943563,
18943607,
18944528,
18976211,
18977208,
18991900,
18993014,
18993094,
19003555,
19005295,
19010333,
19010431,
19010479,
19011403,
19013028,
19015334,
19016935,
19017057,
19017064,
19017067,
19017076,
19017083,
19017103,
19017114,
19017125,
19017139,
19018713,
19019153,
19019386,
19019677,
19028203,
19031064,
19037753,
19040066,
19041320,
19042106,
19047934,
19053856,
19054296,
19059448,
19060588,
19060821,
19062198,
19062672,
19064306,
19073622,
19093716,
19126346,
19134067,
19140419,
19145311,
19146386,
19150479,
19153136,
19155069,
19155395,
19155411,
19155669,
19162472,
19162482,
19162491,
19162499,
19172148,
19174168,
19174351,
19177052,
19178695,
19179390,
19186792,
19188222,
19192813,
19194738,
19195161,
19197708,
19200186,
19200595,
19206752,
19209142,
19210966,
19214323,
19215653,
19245461,
19253018,
19253326,
19254202,
19256834,
19258907,
19261624,
19261729,
19265543,
19275580,
19276323,
19279270,
19287875,
19288614,
19289914,
19290493,
19290857,
19299396,
19302730,
19303864,
19305271,
19307968,
19309012,
19310217,
19311311,
19315261,
19322374,
19325005,
19328333,
19329346,
19329811,
19332062,
19376945,
19380509,
19387386,
19391550,
19394058,
19398489,
19398767,
19401214,
19402176,
19413012,
19413101,
19413496,
19416940,
19417581,
19423343,
19430337,
19430792,
19438549,
19438691,
19441609,
19453175,
19454608,
19456732,
19459806,
19460350,
19461377,
19461441,
19466216,
19468339,
19468345,
19468363,
19468370,
19468373,
19473436,
19474031,
19475258,
19481960,
19483656,
19484165,
19484503,
19486292,
19488012,
19528410,
19529007,
19529271,
19530646,
19532875,
19533665,
19536993,
19546983,
19548819,
19550174,
19551151,
19551890,
19552986,
19553009,
19553012,
19553017,
19553021,
19553023,
19553026,
19553028,
19553048,
19553396,
19566583,
19568296,
19574759,
19574955,
19577380,
19577961,
19578125,
19579083,
19579480,
19579906,
19586313,
19590298,
19590640,
19590646,
19590853,
19591591,
19594758,
19595541,
19596873,
19598108,
19600178,
19603292,
19605126,
19607246,
19610147,
19611351,
19611368,
19612211,
19612327,
19615807,
19616010,
19616032,
19617580,
19646662,
19654362,
19655424,
19657914,
19659844,
19663038,
19666238,
19667893,
19668251,
19669049,
19669422,
19681911,
19683246,
19685658,
19688843,
19688845,
19688854,
19688883,
19692464,
19702807,
19703090,
19713165,
19716327,
19720958,
19722470,
19722963,
19726376,
19726756,
19727479,
19728010,
19781464,
19786150,
19792227,
19795996,
19796270,
19797387,
19799547,
19799571,
19800404,
19800572,
19801511,
19801532,
19801536,
19801564,
19812941,
19814737,
19815415,
19817806,
19818376,
19818987,
19820038,
19820572,
19820785,
19821344,
19823326,
19832450,
19834395,
19837386,
19838369,
19843335,
19844492,
19856229,
19856904,
19856913,
19856920,
19860620,
19861191,
19862968,
19863243,
19863743,
19863986,
19871264,
19871573,
19874422,
19887081,
19899166,
19904939
]
}
}
]
}
}
]
}
}
]
}
}
]
}
},
"sort": [
{
"updated_at": {
"order": "desc"
}
},
"_score"
],
"highlight": {
"fields": {
"title": {},
"description": {}
}
}
}
query2.json (just remove the redundant group scope params)
{
"query": {
"bool": {
"must": [
{
"simple_query_string": {
"fields": [
"title^2",
"description"
],
"query": "<QUERY>",
"default_operator": "and"
}
}
],
"filter": [
{
"term": {
"type": "issue"
}
},
{
"has_parent": {
"parent_type": "project",
"query": {
"bool": {
"should": [
{
"bool": {
"filter": [
{
"terms": {
"id": [
278964
]
}
},
{
"terms": {
"issues_access_level": [
20,
10
]
}
}
]
}
}
]
}
}
}
}
]
}
},
"highlight": {
"fields": {
"title": {},
"description": {}
}
}
}
query3.json (also simplify to not check the access level, use `rid` instead of parent join)
{
"query": {
"bool": {
"must": [
{
"simple_query_string": {
"fields": [
"title^2",
"description"
],
"query": "<QUERY>",
"default_operator": "and"
}
}
],
"filter": [
{
"term": {
"type": "issue"
}
},
{
"term": {
"rid": 278964
}
}
]
}
},
"sort": [
{
"updated_at": {
"order": "desc"
}
},
"_score"
],
"highlight": {
"fields": {
"title": {},
"description": {}
}
}
}
query4.json (also remove highlighting since we don't use this for issue search)
{
"query": {
"bool": {
"must": [
{
"simple_query_string": {
"fields": [
"title^2",
"description"
],
"query": "<QUERY>",
"default_operator": "and"
}
}
],
"filter": [
{
"term": {
"type": "issue"
}
},
{
"term": {
"rid": 278964
}
}
]
}
},
"sort": [
{
"updated_at": {
"order": "desc"
}
},
"_score"
]
}
benchmark.rb
require 'benchmark'
require 'rest-client'
CLUSTER_URL = ENV.fetch('CLUSTER_URL')
INDEX = ENV.fetch('INDEX')
QUERY1 = File.read('query1.json')
QUERY2 = File.read('query2.json')
QUERY3 = File.read('query3.json')
QUERY4 = File.read('query4.json')
QUERIES = ['elasticsearch storage', '*', 'goodbye world', 'some search', 'another search', 'hello world', 'analyze elasticsearch storage']
def search(request)
query = QUERIES.sample
RestClient.post("#{CLUSTER_URL}/#{INDEX}/_search?routing=project_278964", request.sub('<QUERY>', query), {content_type: :json, accept: :json})
end
10.times do # Warm cache
search(QUERY1)
search(QUERY2)
search(QUERY3)
search(QUERY4)
end
n = 30
Benchmark.bm(15) do |x|
x.report("Query 1") { n.times { search(QUERY1) } }
x.report("Query 2") { n.times { search(QUERY2) } }
x.report("Query 3") { n.times { search(QUERY3) } }
x.report("Query 4") { n.times { search(QUERY4) } }
end
Results
user system total real
Query 1 0.593083 0.079812 0.672895 ( 56.143645)
Query 2 0.578645 0.053428 0.632073 ( 25.267649)
Query 3 0.465211 0.033835 0.499046 ( 21.723905)
Query 4 0.568647 0.043543 0.612190 ( 22.154440)
We can see that we'll make a dramatic improvement >50% if all we do is remove the redundant part of the query. Then we'll make a further small improvement if we can remove the use of join and just use the rid
field. Removing the highlighting doesn't improve anything so doesn't need to be a focus for this issue.