Hi John, I guess I might not express clearly what I meant. Take a query like below: select col1, col2, col3 from tbl where col4 < 1.5
how does fastbit find the records for col1, col2, col3 where col4 is less than 1.5? Thanks, Min On Sat, Oct 31, 2009 at 6:15 AM, K. John Wu <[email protected]> wrote: > Hi, Min, > > I am not sure if you are asking a question, but that has never stopped > my trying to say something. > > First off, no matter whether a column is indexed or not, you can use > in a select clause, e.g. "select col1, avg(col2)" or "select col2, > sum(col1)", or a where clause "where col1 > 5 and col2 < 2" or where > "col1 > 100 and col3 between 100 and 110". > > The parser will try to detect whether all the names are column names > or aliases. You will see a warning message if some of them are not. > > When evaluating the where clause, FastBit will attempt to use an > index. If the index is not available, it will try to create one. In > fact, if you want to stop FastBit from trying, you will need to > instruction FastBit to not index a particular column with something like > > index=none > > either in the -part.txt file or in a configuration file. > > Hope this helps. > > John > > > > On 10/29/2009 8:38 PM, Min Zhou wrote: >> Thank you for your reply, John. >> >> I understanded that the bitmap is loading through bitwise OR , but I >> do not know how to filter other columns besides col1. >> Very appreciate for your help. >> >> >> Min >> >> >> On Thu, Oct 29, 2009 at 10:55 PM, K. John Wu <[email protected]> wrote: >>> Hi, Min, >>> >>> FastBit does not currently support the operator 'like'. It has been >>> mostly used with numerical values. For string values, the only >>> expression supported is equality test. >>> >>> Assuming you are still interested, here is a quick description of how >>> FastBit handles the following statement >>> >>> select * from table where col1 < 1.5 >>> >>> Given the basic bitmap index, where each distinct value has its own >>> bitmap. when FastBit sees that col1 is involved, it will load the >>> metadata of the index corresponding to col1. Using the metadata, it >>> can figure out which bitmaps needs to be ORed together. Let's say >>> col1 are floating-point values, and there are only three values less >>> than 1.5: 0, 0.5 and 1, then the bitmaps corresponding to these three >>> values marks all the rows that satisfy the condition 'col1 < 1.5.' >>> FastBit needs to perform bitwise OR on these three bitmaps. In this >>> process, only the necessary bitmaps are read into memory from disk. >>> >>> If you are interested in more information about how bitmap works in >>> general, please take a look at >>> <http://en.wikipedia.org/wiki/Bitmap_index>. >>> >>> Two fairly accessible writeups about FastBit are available at >>> <http://ascr-discovery.science.doe.gov/genealogy/fastbit_print.html> >>> and <http://www.scidacreview.org/0904/html/fastbit.html>. >>> >>> John >>> >>> >>> On 10/28/2009 11:08 PM, Min Zhou wrote: >>>> Hi guys, >>>> >>>> if I have a table with 5 columns(col1, col2 ... col5), they will be >>>> splitted into 5 files, and col1 be indexed by fastbit. >>>> can you describe how fastbit do such a query like >>>> >>>> select * from tbl where col1 like '%xyz%' >>>> >>>> I guess fastbit will load bitmaps in memory, fetch the hits by >>>> bitmaps, I don't know how fastbit output other columns. >>>> >>>> >>>> Regards, >>>> Min >>> _______________________________________________ >>> FastBit-users mailing list >>> [email protected] >>> https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users >>> >> >> >> > > _______________________________________________ > FastBit-users mailing list > [email protected] > https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users > -- My research interests are distributed systems, parallel computing and bytecode based virtual machine. My profile: http://www.linkedin.com/in/coderplay My blog: http://coderplay.javaeye.com _______________________________________________ FastBit-users mailing list [email protected] https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
