Re: How to implement this idea
- From: makc.the.great@xxxxxxxxx
- Date: 9 Oct 2006 05:06:33 -0700
rossum wrote:
On 9 Oct 2006 02:48:34 -0700, sticker.ji@xxxxxxxxx wrote:
I have a dataset which contains records. The record can be treated as aI assume you meant C instead of G
set, which contains elements with no duplication.
The query is a pair of elements. The system should return all the
records containning both of the elements.
How to implement this function quickly?
Example:
dataset:
record 1: {A B D F G}
record 1: {A B D F C}
record 2: {A C T Y}
record 3: {B C D Q L}
query {B C} returns 1, 3.
query {A F} return 1.
query {A H} return null.
The query will always be a pair of elements. No other format of query
exists.
Thank you very much for your idea.
Set up an inverted index:
element A: {r1 r2}
element B: {r1 r3}
element C: {r1 r2 r3}
element D: {r1 r3}
element E: {}
element F: {r1}
Retrieve the entries for the given two elements and return the
intersection of the two returned sets.
rossum
that's surely fastest way, but it is also a hungriest. such index will
occupy much more space than dataset itself.
.
- Follow-Ups:
- Re: How to implement this idea
- From: rossum
- Re: How to implement this idea
- References:
- How to implement this idea
- From: sticker . ji
- Re: How to implement this idea
- From: rossum
- How to implement this idea
- Prev by Date: Re: How to implement this idea
- Next by Date: Re: Windows App with semi-transparent UI as an "overlay" - possible?
- Previous by thread: Re: How to implement this idea
- Next by thread: Re: How to implement this idea
- Index(es):
Relevant Pages
|