Hbase查询花费很长时间

时间:2020-05-13 20:18:53

标签: hbase

 final Scan scan = new Scan();
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_city"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_cntry"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_cour_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_fax_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_last_upd_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_last_upd_user"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_line1"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_line2"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_ph_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_ph_num_ext"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_state"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_tkn"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_type"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_zip_code"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_address_t37_zip_code_ext"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_addr_tkn"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_case_court_type"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_case_seq_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_case_year"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_cnty_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_cnty_res"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_last_upd_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_last_upd_user"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_notfy_allow"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_prty_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_prty_role"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ADDRESS) , Bytes.toBytes("cv00_prty_addr_t47_tp"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_alias_ent_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_case_court_type"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_case_seq_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_case_year"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_cnty_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_last_upd_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_last_upd_user"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_name"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_prty_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_prty_role"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_sound_x"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_stat"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ALIAS) , Bytes.toBytes("cv00_prty_alis_t46_tax_id_ssn"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_city"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_cntry"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_cour_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_fax_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_last_upd_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_last_upd_user"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_line1"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_line2"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_ph_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_ph_num_ext"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_state"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_tkn"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_type"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_zip_code"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_address_att_t37_zip_code_ext"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_atty_t25_addr_tkn"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_atty_t25_atty_name"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_atty_t25_bar_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_atty_t25_ent_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_atty_t25_firm_name"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_atty_t25_last_upd_pgm"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_atty_t25_last_upd_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_atty_t25_last_upd_user"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_atty_t25_stat"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_atty_t25_tax_id_ssn"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_atty_bar_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_case_court_type"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_case_seq_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_case_year"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_cnty_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_last_upd_pgm"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_last_upd_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_last_upd_usr"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_prim"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_prty_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_prty_role"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_ATTORNEY) , Bytes.toBytes("cv00_prty_atty_t29_tkn"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_case_court_type"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_case_seq_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_case_year"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_cnty_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_ent_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_indigency_ind"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_inval_ssn"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_jdgmn_ind"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_last_upd_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_last_upd_user"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_name"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_priv_ind"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_rmvd_indx_ind"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_role"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_sound_x"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_stat"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_PARTY) , Bytes.toBytes("cv00_party_t48_tax_id_ssn"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_case_court_type"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_case_seq_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_case_year"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_cnty_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_curr_name"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_curr_nm_sound_x"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_ent_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_jdgmn_ind"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_last_upd_ts"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_last_upd_user"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_prev_name"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_prev_nm_sound_x"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_prty_num"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_prty_role"));
    scan.addColumn(Bytes.toBytes(ICivilCasePartiesDao.CF_NAME_CHG) , Bytes.toBytes("cv00_name_hst_t65_reason"));

    final Filter filter = new PrefixFilter(Bytes.toBytes(caseKey));
    scan.setFilter(filter);
    final List<CivilCaseParty> rows = hbaseTemplate.find(
            ICivilCasePartiesDao.HB_TABLE_PARTY, scan,
            new CasePartiesMapper());

大约需要17分钟。我们之前使用Phoenix来查询相同的数据,而且还不到一分钟。

查询很简单,它列出了cols和相应的col家族,并且正在查找行键以casekey开头(所有行以casekey开头)的所有行。

如何调整此直接查询以提高性能

0 个答案:

没有答案