Navigation Menu

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

A select with many constants in --query fails #444

Closed
s-yata opened this issue Dec 9, 2015 · 2 comments
Closed

A select with many constants in --query fails #444

s-yata opened this issue Dec 9, 2015 · 2 comments
Assignees
Labels

Comments

@s-yata
Copy link
Contributor

s-yata commented Dec 9, 2015

Description

A select with many constants (more than 1,024) in --query fails as follows:

[[-63,1449635050.73118,0.00283455848693848,"stack under flow in relative op",
 [["grn_expr_append_obj","expr.c",938],...

An error log says "too many constants".

2015-12-09 13:10:03.231572|e| too many constants.
2015-12-09 13:10:03.232183|e| /home/s-yata/git/groonga/lib/.libs/libgroonga.so.0(grn_expr_alloc_const+0xee) [0x7fcf90e9926e]
...
2015-12-09 13:10:03.232396|e| obj not assigned for GRN_OP_PUSH
2015-12-09 13:10:03.232625|e| /home/s-yata/git/groonga/lib/.libs/libgroonga.so.0(grn_expr_append_obj+0x1f88) [0x7fcf90e9dd18]
...
2015-12-09 13:10:03.232670|e| stack under flow in relative op
2015-12-09 13:10:03.232881|e| /home/s-yata/git/groonga/lib/.libs/libgroonga.so.0(grn_expr_append_obj+0x1286) [0x7fcf90e9d016]

The buffer size for constants is GRN_STACK_SIZE, like in #443 .

@s-yata s-yata self-assigned this Dec 9, 2015
@s-yata s-yata added the doing label Dec 9, 2015
s-yata added a commit that referenced this issue Dec 9, 2015
@s-yata
Copy link
Contributor Author

s-yata commented Dec 9, 2015

The above commit (96427b0) updates grn_expr to allocate a new block when its buffer for constants is full.
Note that the address of each constant must not be modified in reallocation.

@s-yata
Copy link
Contributor Author

s-yata commented Dec 9, 2015

The latest version can execute a select with 2,000 ORs in --query.

ORx2000.txt

However, please note that such a select may take much long time.

> select article --match_columns body --query '天気'
[[0,1449641126.55815,0.000834941864013672],
 [[[1],[["_id","UInt32"],["_key","UInt32"],["body","LongText"],["title","ShortText"]],
   [1,1,"今日は良い天気ですね.","本日は晴天なり"]]]]

> select article --match_columns body --query \
  '0 OR 1 OR 2 OR 3 OR 4 OR 5 OR 6 OR 7 OR 8 OR 9 OR \
   10 OR 11 OR 12 OR 13 OR 14 OR 15 OR 16 OR 17 OR 18 OR 19 OR \
   ... \
   OR 天気'
[[0,1449641126.55908,0.190096139907837],
 [[[1],[["_id","UInt32"],["_key","UInt32"],["body","LongText"],["title","ShortText"]],
   [1,1,"今日は良い天気ですね.","本日は晴天なり"]]]]

@s-yata s-yata added done and removed doing labels Dec 9, 2015
@s-yata s-yata closed this as completed Dec 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant