Index linking with two links to the same table

28 views
Skip to first unread message

mii...@metosin.fi

unread,
Jun 19, 2017, 5:09:31 AM6/19/17
to ZomboDB
Hi,

I've been trying out ZomboDB and it looks very promising so far. Today I encountered a problem with index linking where I want to have two links from table A to table B. Our schema looks something like this:

CREATE TABLE a (
  id SERIAL PRIMARY KEY
,
  b1 INTEGER REFERENCES b
(id),
  b2 INTEGER REFERENCES b
(id)
)

CREATE TABLE b
(
  id SERIAL PRIMARY KEY
,
  name TEXT
)

I want to use ZomboDB to query table A with references to the fields of b1 and b2. The index linking options look something like this:

b1_:(b1=<b.idx_zdb_b>id),
b2_
:(b2=<b.idx_zdb_b>id)

Now queries like `b1_.name:whatever` work as expected but queries like `b2_.name:whatever` do not return any results. If I swap the order of b1_ and b2_ in the options, then b2_ starts working and b1_ stops working.

Am I missing something, or have I hit a limitation of ZomboDB?



Miikka

Eric Ridge

unread,
Jun 19, 2017, 1:12:22 PM6/19/17
to zom...@googlegroups.com

Hi Miikka!

 

You may have found a bug, or maybe you’re using an older known-to-be-bugged version of ZomboDB? 

 

Which version of ZDB are you using?  You should be on v3.1.12.

 

But maybe this is a bug.  I’m honestly not sure what ZDB would want to do in this situation.  I can see why you’d want to create links like this, but it might be that ZDB wants to prefer the first index listed (since they’re both the same), despite the fact that they’re named.  If that’s true, it’s definitely a bug.

 

If you will, confirm with me the version of ZDB you’re using.  If it is v3.1.2, then please create an issue on GitHub and I’ll get it fixed in the upcoming release (which I hope to release later this week).

 

For what it’s worth, the “index linking” feature is extremely complex, so I wouldn’t be surprised if there’s yet another bug in there.

 

eric

--
You received this message because you are subscribed to the Google Groups "ZomboDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zombodb+u...@googlegroups.com.
To post to this group, send email to zom...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zombodb/29d4aa36-ec1b-4165-9a93-573c850daf4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

mii...@metosin.fi

unread,
Jun 20, 2017, 1:22:53 AM6/20/17
to ZomboDB
This is indeed on v3.1.12. I opened an issue here: https://github.com/zombodb/zombodb/issues/210


Miikka

Eric Ridge

unread,
Jun 20, 2017, 1:26:29 AM6/20/17
to ZomboDB
I saw it. Thank you very much. We'll get it fixed shortly!

eric
Reply all
Reply to author
Forward
0 new messages