Consistency Level For Query Workbench

Is there a way to specific consistency level, such as RequestPlus, when executing queries via the Query Workbench? We’re writing a pair of maintenance queries where the second query needs to have the mutations from the first query indexed before running. Since the second query is also a mutation query, running with inconsistent results could be problematic.

Thanks,
Brant

Hi @btburnett3

You can do this with the cbq shell as follows

\SET -scan_consistency REQUEST_PLUS;
(Since scan consistency is a query parameter. All query parameters are set using - prefix followed by the value.)
select * …

For query workbench @eben will be the best person to suggest a solution.

Thanks
Isha

1 Like

There is no way to specify query consistency currently in the query workbench, though I’ll look into adding that as a feature in the next release.

1 Like

Thanks guys, I appreciate the info.

Brant

Hello,
I’m trying to set the consistency parameter at query level, but sintax error is displayed.

select - scan_consistency REQUEST_PLUS count(*) from ;

How would be?
Thanks
Arturo

Hello, can you look up the documentation about cbq shell.

Or are you using an SDK.

Hello,
From cbq is rigth:

\SET -scan_consistency REQUEST_PLUS;
cbq> \SET;
Query Parameters :
Parameter name : scan_consistency
Value : [“REQUEST_PLUS”]

Named Parameters :
User Defined Session Parameters :
Predefined Session Parameters :
Parameter name : histfile
Value : [".cbq_history"]

Is posible to set this parameter at query level?
Thanks

Well, you can call \SET before every query.

@isha, is it possible to specify parameters with each query?

@arturo.gutierrez.gom, I know this is possible with curl and the N1QL REST API. If you want to use curl, I will send you a link.

Once you set the value of scan_consistency in the shell, it sets it for all the queries that are executed until \UNSET.

So if you want the value to only be set for a single query, you can do the following
\SET -scan_consistency REQUEST_PLUS;
select … ;
\UNSET -scan_consistency;

select … (This query will not have the scan consistency set… )

1 Like

O.k .
This way si correct for me. And providme the rígth way.
Thanks
Arturo

1 Like