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

HAWQ-47. Make user able to set statement level resource usage. #34

Closed
wants to merge 2 commits into from

Conversation

jiny2
Copy link
Contributor

@jiny2 jiny2 commented Oct 22, 2015

user can use the following statements to set statement level resource quota. When statement level resource quota is active, target hawq resource queue setting is almost all ignored, only the resource queue capacity is considered, i.e. user can not set resource quota more than maximum capacity of the target queue.

the vseg memory can only be chosen from finite value sets : 128mb, 256mb, 512mb, 1024mb/1gb, 2048mb/2gb, 4096mb/4gb, ..., 16384mb/16gb

postgres=# show hawq_rm_stmt_nvseg;

hawq_rm_stmt_nvseg

0
(1 row)

postgres=# show hawq_rm_stmt_vseg_memory;

hawq_rm_stmt_vseg_memory

128mb
(1 row)

postgres=# set hawq_rm_stmt_nvseg=8;
SET
postgres=# set hawq_rm_stmt_vseg_memory='1gb';
SET
postgres=# insert into t values(1);
INSERT 0 1

postgres=# set hawq_rm_stmt_nvseg=10; -- in case setting too much resource!
SET
postgres=# insert into t values(1);
ERROR: failed to acquire resource because of remote error expecting too many virtual segments. (pquery.c:798)

Some error message refinement changes are also included.

@jiny2
Copy link
Contributor Author

jiny2 commented Oct 26, 2015

Update error manage to ERROR: failed to acquire resource because of expecting too many virtual segments.

if ( res != FUNC_RETURN_OK )
{
elog(WARNING, "Failed to return resource when cleaning up "
"resource context.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code indent, "}" at the next line should match "{"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not find the mismatch.

@linwen
Copy link
Contributor

linwen commented Oct 26, 2015

Looks good, except some code indent.

@asfgit asfgit closed this in 3a8dcd2 Oct 26, 2015
@jiny2 jiny2 deleted the HAWQ-47 branch October 26, 2015 23:34
@amyrazz44
Copy link
Contributor

Looks good to me

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