Hi, Valeria, The second way (in thula.cpp) might be better in general. The ibis::query object has some trouble with "count(*)". If you use ibis::query directly, it is best to leave out "count(*)". You can get the same information from the function ibis::query::getNumHits.
John On 3/29/2010 1:19 AM, Valeria Lorenzetti wrote: > Hi John, > I saw that there are many ways to access Fastbit-data and run a query. > > From ibis.cpp: > ibis::query aQuery(uid, tbl); > aQuery.setWhereClause(wstr); > aQuery.setSelectClause(sstr); > aQuery.evaluate(); > num1 = aQuery.getNumHits(); > > From thula.cpp > ibis::table *sel = 0; > sel = tbl.select(sstr, wstr); > n1 = tbl.nRows(); > > > I'd like to know what is the best way (faster and more flexible) to > manage the results. I need to apply efficiently some functions on > these, like DISTINCT, ORDERBY, LIMIT, etc. Moreover, I need to access > the rows individually to print them in a customized way (e.g. with an > XML format). > > At this time, to run a query, I'm using the first method: > > ibis::part part (directory, static_cast<const char*>(0)); > ibis::query q (name,&part); > q.setSelectClause (select_clause); > q.setWhereClause (where_clause); > q.evaluate(); > > To access and manage every single row, I'm using: > ibis::bundle * b = ibis::bundle::create (q); > > and to access every single value (i,j) of the row, to build a > customized output, I'm using: > b.getUInt (row-id, col-id); > > > However, I'm pretty sure that this is not the best way to manage the results. > Can you give me some advice on the functions to use? > > Thanks in advance, > Valeria Lorenzetti > _______________________________________________ > 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
