Clarification needed: DB.Tables API

Hey, badger team:

I’m playing with a badger table (managed DB, if that matters). The db is quite small, ~40 rows for now.

However, if I use db.Tables(true), it gives me nothing.

I’m a bit confused, there is no Tables?
Can anyone explain? thanks.

@yangzh Since data in DB is quite small, all of it might be in memory(skiplists). Hence db.Tables() is returning nothing. You might be having single .vlog file.

@ashishgoswami, thanks for the response, it might be totally true.

However, I was not comfortable with the convention:

I did put some stuff in the DB, and Tables returns me nothing? What should I do if I want to do some key split, similar to Stream does?

On the other hand, ff DB.Tables() does return anything, does that includes keys in memory skip lists?

Hey, @ashishgoswami, do you have any answer for my questions? thanks.

Hey @yangzh, db.Tables() returns data related to persisted tables. It does not include data about skip lists.
It is mostly used in info tool and stream framework(used for backup).

Let know me what are you trying to do.

So suppose I want to consume all key-value pairs from a table in a way similar to the Stream framework, with proper split among them, for load balancing, (I noticed Stream uses db.Tables under the hood), if db.Tables only gives me persisted tables (instead of memory table), do I have to have special treatment for memory tables?

Stream framework has single table iterator as the smallest unit for which it iterates in parallel. I am not sure if you can do something similar for a single table.