Forum BigDB Indexing Empty Table: Bug or Feature?

Discussion and help relating to the PlayerIO database solution, BigDB.

Indexing Empty Table: Bug or Feature?

Postby phil.peron » January 27th, 2011, 4:16 am

Hey guys,

I was recently running a test where I processed a table full of consumables. Once the table was empty, items were eventually added but the index never reflected these newly added objects. Here's a boiled down example...

Let's say I have a table called "Fruit" and an Index called "Freshness" [Fresh (Boolean, Ascending)]. Items in the "Fruit" table look like this:

Code: Select all
1 = { Type:'Banana', Fresh:true }
2 = { Type:'Apple', Fresh:true }
3 = { Type:'Orange', Fresh:true }


Objects are loaded via the LoadRange() method:

Code: Select all
PlayerIO.BigDB.LoadRange("Fruit", "Freshness", null, null, null, 10,
    delegate(DatabaseObject[] results)
    {
        Console.WriteLine("found " + results.Length + " results.");
    }
);


Again, all is well until the fruit runs out. After that, even with new fruit added, I no longer receive any more results from the loaded range.

Is this the intended behavior? I'm able to work around the issue by using an object "primer" like this:

Code: Select all
0 = { Type:'Primer, Fresh:true }


And ignoring it completely when the game logic runs.

Can anyone provide some insight to this issue?
phil.peron
 
Posts: 35
Joined: September 24th, 2010, 7:50 pm

Re: Indexing Empty Table: Bug or Feature?

Postby Henrik » January 27th, 2011, 2:23 pm

Hi Phil,

That sounds very weird, and it's certainly not the way it's supposed to work. We'll investigate this as soon as we can!
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Indexing Empty Table: Bug or Feature?

Postby Henrik » February 8th, 2011, 2:47 pm

Hey again Phil, sorry for the late reply.

I can't reproduce this in any way. Was it a single occurrence where an index just didn't work, or can you consistently trigger the error?

If you have some sample code that doesn't work, feel free to email me at henrik at player.io
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Indexing Empty Table: Bug or Feature?

Postby phil.peron » February 8th, 2011, 4:26 pm

Hi Henrik,

No worries. I did have some example code but we've changed our design quite a bit and this method is no longer necessary.

If time allows, I can regenerate it but otherwise things are working out well. I'll let you know if we hit this again in the future.

Thanks for your time.

Phil
phil.peron
 
Posts: 35
Joined: September 24th, 2010, 7:50 pm


Return to BigDB