Author Topic: Efficient count  (Read 2536 times)

smaupin

  • Guest
Efficient count
« on: March 23, 2015, 05:55:25 AM »
Hello,

Our CMOD service provider recently moved his technical infrasctructure.

i'm in charge to control with OdWek Api the consistency of moved data.

Our first approch is to compare the number of documents by posting date.

but, sometimes, for one posting date we have some billion of documents, which causes out of memory in our java control program.

My team is new and not familiar with odwek API ( i'm new to this API too ), and i wonder if we are doing it right :

After setting the posting date to check with odcriteria.
we are doing a

Code: [Select]
List<ODHit> hits = odFolder.search();
and after an hits.size();

this on the two server to compare size between the two architecture.


is there a more efficient mean to make a kind of sql "count  *" with odwek api  ?


Thanks for future replies and sorry for my English ...




Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Efficient count
« Reply #1 on: March 23, 2015, 06:14:54 AM »
Try with

long countHits = odFolder.searchCountHits();

Which ODWek version do you have?
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

smaupin

  • Guest
Re: Efficient count
« Reply #2 on: March 23, 2015, 08:23:02 AM »
Thanks for reply.

odwek 8.5

we tested this method but we didn't use it because of inconsistent results.

but we found a "hidden" setMaxHits in code which was the reason of this inconsistency.

it's better with memory

The out of memory problem will occur now only with search but with restrictive criteria we can avoid it.

thanks !!

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Efficient count
« Reply #3 on: March 23, 2015, 08:51:39 AM »
If you have some inconsistency, then please open a PMR, or before try the latest ODWEK version (8.5.0.10, or even 9.5.0.1).
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

smaupin

  • Guest
Re: Efficient count
« Reply #4 on: March 23, 2015, 10:19:18 AM »
in fact, it works on the first server, on the other it returns 0

i will ask out CMOD service provider about this.

Thanks