dbTalk Databases Forums  

conditional join

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss conditional join in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
niagara_man@hotmail.com
 
Posts: n/a

Default conditional join - 03-07-2006 , 10:15 AM






Hi!
Any ideas on how you can create an index for something like this?:
....
abs(to_number(a.date) - (to_number(b.date)) < 2

Any ideas on how you could use berkeley-db to seach in this manner that
is not of Order(N x N)?

Thanks
E


Reply With Quote
  #2  
Old   
michael.cahill@gmail.com
 
Posts: n/a

Default Re: conditional join - 03-08-2006 , 12:13 AM






Hi,

I'm not entirely sure that I understand your question, but how about
creating a btree secondary using the date as a key. Either encode the
date so that it is in sorted order or supply a key comparator.

Then for a given item (with known date), you can look up the date index
and scan up and down until you reach the distance limits.

Would that do what you want?

Michael.


Reply With Quote
  #3  
Old   
niagara_man@hotmail.com
 
Posts: n/a

Default Re: conditional join - 03-08-2006 , 04:18 PM



I will probably do something similar. I am going to have two index
databases, one for table/database A and B. I then want to find all
possible records where this condition is true:
abs(to_number(a.data) - (to_number(b.data)) < 2
I will put all records where this condition is true into a new
table/database. Table A and B could potentially have millions of
records. I was just curious to see if anyone had any good ideas for
solving this problem using berkeley. (i.e. Ideas to speed up
performance/comparisons/IO)
Thanks


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.