database-scan

Redis keys function for match with multiple pattern

瘦欲@ 提交于 2020-08-09 13:35:33
问题 How i can find keys with multiple match pattern, for example i've keys with foo:*, event:*, poi:* and article:* patterns. how i find keys with redis keys function for match with foo:* or poi:* pattern, its like find all keys with preffix foo:* or poi:* 回答1: You should not do this. KEYS is mainly a debug command. It is not supposed to be used for anything else. Redis is not a database supporting ad-hoc queries: you are supposed to provide access paths for the data you put into Redis (using

HBase (Easy): How to Perform Range Prefix Scan in hbase shell

那年仲夏 提交于 2019-12-29 02:51:32
问题 I am designing an app to run on hbase and want to interactively explore the contents of my cluster. I am in the hbase shell and I want to perform a scan of all keys starting with the chars "abc". Such keys might inlcude "abc4", "abc92", "abc20014" etc... I tried a scan hbase(main):003:0> scan 'mytable', {STARTROW => 'abc', ENDROW => 'abc'} But this does not seem to return anything since there is technically no rowkey "abc" only rowkeys starting with "abc" What I want is something like hbase

Should I use prefixfilter or rowkey range scan in HBase

為{幸葍}努か 提交于 2019-12-17 19:01:52
问题 I don't know why it's very slow if I use prefixfilter to query. Can someone explain which is the best way to query HBase, thanks. hbase(main):002:0> scan 'userlib',{FILTER=>org.apache.hadoop.hbase.filter.PrefixFilter.new(org.apache.hadoop.hbase.util.Bytes.toBytes('0000115831F8'))} ROW COLUMN+CELL 0000115831F8001 column=track:aid, timestamp=1339121507633, value=aaa 1 row(s) in 41.0700 seconds hbase(main):002:0> scan 'userlib',{STARTROW=>'0000115831F8',ENDROW=>'0000115831F9'} ROW COLUMN+CELL

Automating table/object name scan and search in SAS

北城以北 提交于 2019-12-11 03:14:08
问题 OK I'll start with the problem: I have product tables being created every week which are named in the format: products_20130701 products_20130708 . . . I'm trying to automate some campaign analysis so that I don't have to manually change the table name in the code every week to use whichever product table is the first one after the maximum end date of my campaign. e.g %put &max_enddate.; /*20130603*/ my product tables in June are: products_20130602 *products_20130609* products_20130616

Scanning a mysql table from the bottom

不打扰是莪最后的温柔 提交于 2019-12-08 13:17:17
问题 When i run a mysql select statement, it takes very long because i have already previously deleted a very large number of rows. Is there a way for the table to start scanning from the bottom, as opposed to from the top? 回答1: A query does not scan the table in any particular order; it might do so if it happens to traverse a particular index in order (e.g. a range scan), which MIGHT be because you used an ORDER BY. Databases just don't work like that. You cannot rely on their behaviour in that

How to apply several QualifierFilter to a row in HBase

ⅰ亾dé卋堺 提交于 2019-12-07 00:21:17
问题 we would like to filter a scan on a HBase table with two QualifierFilters. Means we would like to only get the rows of the table which do have a certain column 'col_A' AND (!) a certain other column 'col_B'. Our current approach looks like this: FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL); Filter filter1 = new QualifierFilter(CompareOp.EQUAL, new BinaryComparator("col_A".getBytes())); filterList.addFilter(filter1); Filter filter2 = new QualifierFilter(CompareOp

How to apply several QualifierFilter to a row in HBase

≡放荡痞女 提交于 2019-12-05 05:41:35
we would like to filter a scan on a HBase table with two QualifierFilters. Means we would like to only get the rows of the table which do have a certain column 'col_A' AND (!) a certain other column 'col_B'. Our current approach looks like this: FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL); Filter filter1 = new QualifierFilter(CompareOp.EQUAL, new BinaryComparator("col_A".getBytes())); filterList.addFilter(filter1); Filter filter2 = new QualifierFilter(CompareOp.EQUAL, new BinaryComparator("col_B".getBytes())); filterList.addFilter(filter2); Scan scan = new Scan();

HBase Scan Performance

三世轮回 提交于 2019-11-30 13:09:40
I am performing a range scan that is giving me 500k records. If I set scan.setCaching(100000) it took less than one second, but if scan.setCaching(100000) is not set it took nearly 38 sec. If I set scan.setBlockCache(false) and scan.setCaching(100000) what will happen? Will the rows be cached or not? I am dropping OS cache after first scan but there is no change in the time for scanning the records. Why? Then how can I check the read performance? Scan.setCaching is a misnomer. It should really be called something like Scan.setPrefetch . setCaching actually specifies how many rows will be

HBase Scan Performance

落爺英雄遲暮 提交于 2019-11-29 18:34:32
问题 I am performing a range scan that is giving me 500k records. If I set scan.setCaching(100000) it took less than one second, but if scan.setCaching(100000) is not set it took nearly 38 sec. If I set scan.setBlockCache(false) and scan.setCaching(100000) what will happen? Will the rows be cached or not? I am dropping OS cache after first scan but there is no change in the time for scanning the records. Why? Then how can I check the read performance? 回答1: Scan.setCaching is a misnomer. It should

HBase (Easy): How to Perform Range Prefix Scan in hbase shell

守給你的承諾、 提交于 2019-11-28 16:52:20
I am designing an app to run on hbase and want to interactively explore the contents of my cluster. I am in the hbase shell and I want to perform a scan of all keys starting with the chars "abc". Such keys might inlcude "abc4", "abc92", "abc20014" etc... I tried a scan hbase(main):003:0> scan 'mytable', {STARTROW => 'abc', ENDROW => 'abc'} But this does not seem to return anything since there is technically no rowkey "abc" only rowkeys starting with "abc" What I want is something like hbase(main):003:0> scan 'mytable', {STARTSROWPREFIX => 'abc', ENDROWPREFIX => 'abc'} I hear HBase can do this