Forum Stats

  • 3,768,730 Users
  • 2,252,841 Discussions
  • 7,874,701 Comments

Discussions

How to get faster the number of records in a je huge database

jcd92410
jcd92410 Member Posts: 8 Blue Ribbon
edited Jun 9, 2016 11:30AM in Berkeley DB Java Edition

Hello,

I have a database of near 32 million records. Getting the number of records with the count() method takes about 9 seconds.

This is not acceptable ! I would appreciate getting advice on this issue, How to optimize ?

The total number of records is not stored somewhere in the B-Tree ?

Thank you in advance for your time,

Best,

JCD

Answers

  • Greybird-Oracle
    Greybird-Oracle Member Posts: 2,690
    edited Jun 9, 2016 11:30AM

    The count() method is currently the fastest way to get the count. The reason for the slowness is that the record count for a Database is *not* stored in the Btree. We currently don't have any plans to store the count.

    --mark

This discussion has been closed.