почему аналогичный запрос mget у одного индекса медленнее другого? - PullRequest
0 голосов
/ 04 апреля 2020

Существует два индекса,

health status index               uuid                   pri rep docs.count docs.deleted store.size pri.store.size

green  open   company             KTngnM6ASD-_KdU0FFAWRA   1   0   75354420     23058482     20.1gb         20.1gb

green  open   person              jb3msRw5S9ixgXN5SLd6bw   1   0  142831390     21903603     20.3gb         20.3gb

одинаковое число, полученное из этих двух индексов, почему company медленнее, чем person?

   +---[312.180518ms] com.foo.bar.oracle2es.service.PersonCompanyPostFullUpdateService:getPersonId2NameMap() #85
   +---[1094.134709ms] com.foo.bar.oracle2es.service.PersonCompanyPostFullUpdateService:getComId2NameMap() #86

PS. Java код

MultiGetRequest multiGetRequest = new MultiGetRequest();
for (Long id : comIdList) {
    MultiGetRequest.Item getRequest = new MultiGetRequest.Item(companyIndex, id.toString());    
    multiGetRequest.add(getRequest);    
}
multiGetRequest.realtime(false);
MultiGetResponse response = restHighLevelClient.mget(multiGetRequest, RequestOptions.DEFAULT);

VS

MultiGetRequest multiGetRequest = new MultiGetRequest();
for (Long id : personIdList) {
    MultiGetRequest.Item getRequest = new MultiGetRequest.Item(personIndex, id.toString());
    multiGetRequest.add(getRequest);
}
multiGetRequest.realtime(false);
MultiGetResponse response = restHighLevelClient.mget(multiGetRequest, RequestOptions.DEFAULT);

/ _ cat / сегменты

index               shard prirep ip             segment generation docs.count docs.deleted     size size.memory committed searchable version compound
company             0     p      xxx.xx.xxx.240 _4uj2       226190   14126011     12942133    5.1gb    14270583 true      true       8.0.0   false
company             0     p      xxx.xx.xxx.240 _7wfm       368626   19791888      5269082      5gb    13966705 true      true       8.0.0   false
company             0     p      xxx.xx.xxx.240 _8n6a       403282   20620770      4196723    5.1gb    13775713 true      true       8.0.0   false
company             0     p      xxx.xx.xxx.240 _96ag       428056   10704275       478997    2.4gb     7150586 true      true       8.0.0   false
company             0     p      xxx.xx.xxx.240 _9c5c       435648     828975        47697  202.5mb      591636 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _9g2j       440731    1173745        53795  279.7mb      811424 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _9qy5       454829    1035723        12684  237.6mb      703365 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _a2nl       470001    1446008        32780    337mb     1018705 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _a7oy       476530     829591         9257  193.7mb      584423 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _anvu       497514      78186         1620   19.3mb       75411 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _aol3       498423      58984         1180   14.4mb       58734 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _aoz9       498933      34575          644    8.5mb       38863 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _aqis       500932      21021         1173    5.6mb       26459 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _aqs8       501272      23976          600    6.1mb       27722 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _aqxs       501472      28310          411    7.1mb       35507 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _ar70       501804      31895          449      8mb       35267 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _arg5       502133      15468         1037    4.1mb       17351 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _arge       502142    4428787         5024 1000.1mb     3215347 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _as0q       502874       9130          297    2.5mb       15139 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _asb1       503245       8646          188    2.3mb       13740 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _asbb       503255       8685          227    2.3mb       14380 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _asbk       503264       8729          228    2.4mb       14327 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _asc2       503282       9633          424    2.6mb       12369 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _at09       504153       7535          101      2mb       12408 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _at0t       504173       7630           86      2mb       12197 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _at13       504183      15271          126    3.9mb       18920 true      true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _au9x       505797        773            4  287.1kb           0 true      false      8.0.0   true
company             0     p      xxx.xx.xxx.240 _au9y       505798          1            0    7.7kb           0 true      false      8.0.0   true
company             0     p      xxx.xx.xxx.240 _au9z       505799          1            0    7.9kb           0 true      false      8.0.0   true
company             0     p      xxx.xx.xxx.240 _aua0       505800          1            0    7.9kb           0 true      false      8.0.0   true
company             0     p      xxx.xx.xxx.240 _aua1       505801          1            0    7.7kb           0 true      false      8.0.0   true
company             0     p      xxx.xx.xxx.240 _auwp       506617        967         1521  571.6kb        5077 false     true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _auwq       506618          1            1    9.7kb        3283 false     true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _auwr       506619          1            0    7.6kb        3260 false     true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _auws       506620          0            1   10.3kb        3540 false     true       8.0.0   true
company             0     p      xxx.xx.xxx.240 _auwt       506621          4            0    9.6kb        3454 false     true       8.0.0   true

VS

index               shard prirep ip             segment generation docs.count docs.deleted     size size.memory committed searchable version compound
person              0     p      xxx.xx.xxx.240 _4tpe       225122   33948196      4575504    4.7gb    14287332 true      true       8.0.0   false
person              0     p      xxx.xx.xxx.240 _4tui       225306   18652889      9813166    3.7gb    12725061 true      true       8.0.0   false
person              0     p      xxx.xx.xxx.240 _4u1r       225567   35960276      3223676    4.7gb    14817833 true      true       8.0.0   false
person              0     p      xxx.xx.xxx.240 _6c3x       295629   35588891      2764346    4.7gb    16541336 true      true       8.0.0   false
person              0     p      xxx.xx.xxx.240 _7hfi       349182    1246760       241028  182.9mb      723915 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _7yz0       371916    2650112       396192  361.8mb     1404686 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _8tnq       411686    2105928       176977  244.1mb      983391 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _a58f       473343    2624429       252188  332.8mb     1358289 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _cwjn       602051    6092940       169283  746.3mb     2755150 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _d66g       614536     723360       105344   89.1mb      425531 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _d7no       616452      61604         3505    7.9mb       43711 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _diok       630740    1853641        42911  216.1mb      910215 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dkze       633722     123437        29833   19.7mb      114567 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dl1q       633806      58361          848    7.4mb       37217 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dlrt       634745     227143        40732   33.9mb      183223 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dov0       638748     226300        15048   31.8mb      171983 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dpcd       639373      22455          203    3.2mb       20034 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dq0i       640242     423347        14922   56.3mb      279861 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dq1x       640293      32928         7497    5.1mb       27638 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dq3g       640348      77050          545   10.4mb       49345 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _ds3m       642946      37617        23121    6.6mb       38592 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _ds3s       642952      42835         6618    5.9mb       32157 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dsgz       643427      22051           47    2.7mb       22629 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dsh9       643437      28293           35    3.8mb       22926 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dtvg       645244        533           22  114.9kb        4889 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dtvq       645254          4            7    8.7kb        1971 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dtw0       645264          5            6    9.2kb        2139 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dtw1       645265          1            0    4.7kb        1448 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dtw2       645266          1            0    4.6kb        1448 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dtw3       645267          1            0    4.7kb        1450 true      true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dtw4       645268          1            0    4.9kb        1450 false     true       8.0.0   true
person              0     p      xxx.xx.xxx.240 _dtw5       645269          1            0    4.8kb        1450 false     true       8.0.0   true

отображения

{
  "company" : {
    "mappings" : {
      "properties" : {
        "curyName" : {
          "type" : "keyword"
        },
        "id" : {
          "type" : "long"
        },
        "induSmaPar" : {
          "type" : "keyword"
        },
        "name" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          },
          "analyzer" : "ik_smart"
        },
        "operCond" : {
          "type" : "keyword"
        },
        "orgDele" : {
          "type" : "keyword"
        },
        "orgDeleCode" : {
          "type" : "long"
        },
        "orgDeleParName" : {
          "type" : "keyword"
        },
        "orgEstDate" : {
          "type" : "keyword"
        },
        "regCap" : {
          "type" : "keyword"
        },
        "shortName" : {
          "type" : "keyword"
        },
        "viewCount" : {
          "type" : "integer"
        },
        "weight" : {
          "type" : "byte"
        }
      }
    }
  }
}

VS

{
  "person" : {
    "mappings" : {
      "properties" : {
        "comNum" : {
          "type" : "integer"
        },
        "company" : {
          "type" : "keyword"
        },
        "id" : {
          "type" : "long"
        },
        "name" : {
          "type" : "keyword"
        },
        "post" : {
          "type" : "keyword"
        },
        "source" : {
          "type" : "byte"
        },
        "viewCount" : {
          "type" : "integer"
        },
        "weight" : {
          "type" : "byte"
        }
      }
    }
  }
}
...