The Wayback Machine - https://web.archive.org/web/20201110183636/https://github.com/vitessio/vitess/issues/6171
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

[olap mode] Add a construct to check if a connection has olap enabled #6171

Open
brirams opened this issue May 11, 2020 · 4 comments
Open

[olap mode] Add a construct to check if a connection has olap enabled #6171

brirams opened this issue May 11, 2020 · 4 comments

Comments

@brirams
Copy link
Collaborator

@brirams brirams commented May 11, 2020

Feature Description

Today, if you enable olap mode on a connection, there is no way to query vitess on that same connection to check if it's been enabled. It would be great to be able to do something along the lines of:

mysql> set workload='olap';
Query OK, 0 rows affected
Time: 0.003s
mysql> select @@workload;
+------------------------------------+
| @@workload                         |
|------------------------------------|
| olap                                                    |
+------------------------------------+

in order to avoid trying to set olap multiple times on the same connection and getting the following error:

mysql> set workload='olap';
Query OK, 0 rows affected
Time: 0.003s
mysql> set workload='olap';
ERROR 1105 (HY000): vtgate: $host:$port/: plan building not supported

Use Case(s)

  • multiplexing different types of queries to olap vs oltp connections based on the results of this check
  • not issuing more set queries than necessary
@setassociative
Copy link
Contributor

@setassociative setassociative commented May 11, 2020

Suggestion -- instead of supporting the ability to query the workload I think it'd be nicer if we could make set workload='olap' a supported/noop operation in olap mode.

The suggested approach means users will need to introduce an extra round trip that shouldn't strictly be necessary.

@brirams
Copy link
Collaborator Author

@brirams brirams commented May 11, 2020

agreed -- i like that, too

@demmer
Copy link
Member

@demmer demmer commented May 11, 2020

Seems to me like we want both the ability to figure out the workload and also make the repeated set workload='olap' a no-op when already in olap mode, right?

@harshit-gangal
Copy link
Member

@harshit-gangal harshit-gangal commented Nov 4, 2020

mysql> select @@workload;
+-------------+
| @@workload  |
+-------------+
| UNSPECIFIED |
+-------------+
1 row in set (0.00 sec)

mysql> set workload = 'olap';
Query OK, 0 rows affected (0.00 sec)

mysql> select @@workload;
+------------+
| @@workload |
+------------+
| OLAP       |
+------------+
1 row in set (0.00 sec)

mysql> set workload = 'oltp';
Query OK, 0 rows affected (0.00 sec)

mysql> select @@workload;
+------------+
| @@workload |
+------------+
| OLTP       |
+------------+
1 row in set (0.00 sec)

Support is added looks like need to fix select @@workload when it is not set.
cc: @systay

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.