Skip to main content

Assign a resource pool at QUERY runtime

  • December 5, 2018
  • 2 replies
  • 15 views

mflower
Forum|alt.badge.img
Hello AskV,
Is there a query-level hint that can force the execution engine to begin with a specific resource pool?
- assuming that the query is being executed within a session, which itself has permission to execute in the specified pool

Something like

SELECT /*+pool('PoolB') */
FROM foo... ;

I am aware that we have the option to define the pool at user and session level etc, and I am also aware that we have cascading pools.
I am looking for a method for QueryX to begin immediately in PoolB instead of firstly trying PoolA and then the query always being cascaded to PoolB after Y seconds.
I'm using AlwaysReplan (select set_config_parameter ('CascadeResourcePoolAlwaysReplan',1); ) so I am wasting Y seconds on each execution of QueryX.
If instead I could direct QueryX straight to PoolB, I might shave up to Y seconds from the query run time .

I do not want to define PoolB at session-level or user-level because within the same session, there will be other queries which I am very happy to begin in PoolA

Regards, Mike


Michael Flower
EMEA Vertica Systems Engineer
(M)+44 7793 757 623
Michael.Flower@microfocus.com

2 replies

Maurizio
Forum|alt.badge.img
  • Participating Frequently
  • December 5, 2018
Hi Mike,

I'm not aware of any "query-level hint" to set the resource pool. What I normally do is:

set session resource_pool = pool_1
SELECT... Query1
SELECT... Query2
set session resource_pool = pool_2
SELECT... Query3
SELECT... Query4
set session resource_pool = pool_1
SELECT... Query5
SELECT... Query6
Etc...

Where Queries 1, 2, 5, 6 will be executed in pool_1 while Queries 3 and 4 are executed in pool_2.

Kind Regards, Maurizio

mflower
Forum|alt.badge.img
  • Author
  • Participating Frequently
  • December 10, 2018

Hello Eugenia, Maurizio.
Thanks for confirming this. It's a shame that, aswell as a session-level definition, there isn't a method of defining this at query-level too.