You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider turning off construction-location backtraces in Ruby driver #1843
Basically, we give two backtraces when a query fails: the first shows where the query was run, and the second shows the line where the erroneous portion of the query was constructed.
If an error occurs during the between, the construction backtrace shows an error for line 1. If an error occurs during the predicate in the filter, the construction backtrace shows an error for line 5. If an error occurs accessing the table, the construction backtrace shows an error for line 8. In all cases, the execution backtrace shows an error for line 8, because that's where the query is actually run.
(Basically, every time we build a portion of a query we record where it was built, and later if the backtrace we get from the server shows that that portion of the query caused the error, we tell the user where it was built.)
PS: @nviennot did some tests as part of #1842 . If I read those numbers correctly, the time difference was in the range of 0.1 ms for constructing a query. So I expect relatively little difference in the numbers that we get from the mentioned benchmark, given that we get only ~500 qps in the first place (so it would be a time saving of ~5%). Now in an environment with multiple concurrent clients (or multi-threaded clients), the impact can be significantly larger though.
After some thought, I think we should just get rid of these backtraces. I think they're probably more confusing than helpful for people who aren't me, even though they're cool. Does anyone object strongly?
Activity
mlucy commentedon Jan 11, 2014
There are two options: turn them off by default, or remove them entirely. I think we should probably do the former.
coffeemug commentedon Jan 11, 2014
Can you describe what this is? Is this something that isn't in the other drivers? I can't read Ruby code :(
mlucy commentedon Jan 11, 2014
This is only in the Ruby driver.
Basically, we give two backtraces when a query fails: the first shows where the query was run, and the second shows the line where the erroneous portion of the query was constructed.
Let's say we have this:
If an error occurs during the
between, the construction backtrace shows an error for line 1. If an error occurs during the predicate in the filter, the construction backtrace shows an error for line 5. If an error occurs accessing the table, the construction backtrace shows an error for line 8. In all cases, the execution backtrace shows an error for line 8, because that's where the query is actually run.(Basically, every time we build a portion of a query we record where it was built, and later if the backtrace we get from the server shows that that portion of the query caused the error, we tell the user where it was built.)
danielmewes commentedon Jan 11, 2014
Would be interesting to know how much the performance impact actually is in a benchmark like https://github.com/ajselvig/RubyDatabaseBenchmarks (also see #1798 ).
That benchmark uses pretty simple queries, so there might be applications where it has more impact. Still it would provide us with a rough ballpark figure.
PS:
@nviennot did some tests as part of #1842 . If I read those numbers correctly, the time difference was in the range of 0.1 ms for constructing a query. So I expect relatively little difference in the numbers that we get from the mentioned benchmark, given that we get only ~500 qps in the first place (so it would be a time saving of ~5%). Now in an environment with multiple concurrent clients (or multi-threaded clients), the impact can be significantly larger though.
nviennot commentedon Jan 11, 2014
This is what I get with rethinkdb next:
Without tracking the caller:
danielmewes commentedon Jan 11, 2014
@nviennot: Cool, thanks for trying that out! Looks like it might well be worth disabling it by default.
mlucy commentedon Jan 15, 2014
After some thought, I think we should just get rid of these backtraces. I think they're probably more confusing than helpful for people who aren't me, even though they're cool. Does anyone object strongly?
mlucy commentedon Jan 15, 2014
Alright, I think I'm gonna do this.
danielmewes commentedon Jan 15, 2014
Yeah it's a really amazing feature, but probably not necessary for most users.
mlucy commentedon Jan 15, 2014
This is in review 1129 by @AtnNn .
mlucy commentedon Jan 30, 2014
In next.