-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Arthur Axel 'fREW' Schmidt
committed
Aug 22, 2015
1 parent
0011e48
commit 8570231
Showing
1 changed file
with
5 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8570231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frioux I think what you want here is the following:
8570231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frioux having had to work with this more - this is actually what you want. However this is no longer a
::Shortcut
...8570231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8570231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frioux so I thought some more - according to https://blog.afoolishmanifesto.com/posts/read-write-splitter/ you send
_select
where it belongs, so I guessresults_exist
can be rewritten as such:The sql it produces is uglier but meh
8570231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also not entirely sure whether it is worth it to be explicit in the return, instead of relying on the boolean that came out of the DBD. That is perhaps it should end with:
8570231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your first suggestion generates sql like this:
We already have an internal version that generates this:
What does the new one generate? Is it (or any of these) actually distinct from the rest wrt performance?
8570231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ this will always return a single row ( low-level, on the cursor, or if you run it in a cmd client )
^^ for a table with 1 million matching records the above will return a set of 1 million single column
1
values ( this is why this issue got started in the 1st place )the new way generates this ( essentially an extra select-wrap against the first variant ):
which again is a single result, it is just uglier than the very top one in my reply ( but it works with your splitter transparrently )
8570231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks