Skip to content

using replica database #571

Answered by orware
esaputras asked this question in Q&A
Dec 11, 2023 · 1 comments · 7 replies
Discussion options

You must be logged in to vote

Hello @esaputras,

Matt's comments above are 100% accurate as after the initial use @replica; from your first line the subsequent two queries would both occur against the replicas if the same connection was used afterward.

Matt can correct me if I'm wrong here but in a quick test using our web console the following did appear to behave as expected so it may be another tip you can use to do what you described.

Should you want to switch back and forth within the same connection, you can probably do the following:

  1. use @replica;
  2. select * from table1;
  3. use @primary; (optionally, you may also simply run use; but use @primary; is more explicit)
  4. select * from table2;

And this would help to allow …

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@orware
Comment options

Answer selected by mattrobenolt
@mattrobenolt
Comment options

@esaputras
Comment options

@mscoutermarsh
Comment options

@mscoutermarsh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants