Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to join tables? #116

Closed
0x410c opened this issue Aug 4, 2018 · 1 comment
Closed

how to join tables? #116

0x410c opened this issue Aug 4, 2018 · 1 comment

Comments

@0x410c
Copy link

0x410c commented Aug 4, 2018

i want to join two tables to find all matchin entries, any alternative if join not available?

@cruppstahl
Copy link
Owner

For full table scans you can use a nested loop with cursors. For optimization, the outer loop should have a higher selectivity, i.e. it should return fewer results than the inner loop.

See the sample env2.c line 225 for a join based on the key values, i.e. without a full table scan. The outer loop is implemented with a cursor. The inner lookup uses ham_db_find/ham_cursor_find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants