-
Notifications
You must be signed in to change notification settings - Fork 31
Conversation
some of them can be unbounded and don't materially change the contents of the query. here's the direct case: SELECT pg_try_advisory_lock ( ? ) AS tabcdef1235
@@ -25,28 +24,16 @@ type QuantizeFunction func(model.Span) model.Span | |||
func Quantize(span model.Span) model.Span { | |||
switch span.Type { | |||
case sqlType: | |||
fallthrough | |||
return QuantizeSQL(span) |
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.
explicit is better than implicit
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.
+1
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.
Good to go!
@@ -25,28 +24,16 @@ type QuantizeFunction func(model.Span) model.Span | |||
func Quantize(span model.Span) model.Span { | |||
switch span.Type { | |||
case sqlType: | |||
fallthrough | |||
return QuantizeSQL(span) |
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.
+1
quantizer/sql.go
Outdated
@@ -51,6 +51,8 @@ func (f *ReplaceFilter) Filter(token, lastToken int, buffer []byte) (int, []byte | |||
return Filtered, []byte("?") | |||
case Limit: | |||
return token, buffer | |||
case As: | |||
return token, []byte("?") |
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.
happy that is quite easy to extend quantizer rules
quantizer/sql_test.go
Outdated
@@ -244,6 +244,10 @@ func TestSQLQuantizer(t *testing.T) { | |||
"SELECT * FROM public.table ( array [ ROW ( array [ 'magic', 'foo',", | |||
"SELECT * FROM public.table ( array [ ROW ( array [ ?", | |||
}, | |||
{ | |||
"SELECT pg_try_advisory_lock (123) AS t46eef3f025cc27feb31ca5a2d668a09a", | |||
"SELECT pg_try_advisory_lock ( ? ) AS ?", |
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.
For now I think it's ok, we may want (as you've already suggested) to drop all tables/store procedures aliasing. We may keep track of this change for the future.
@palazzem we talked about completely dropping all the |
some of them can be unbounded and don't materially change the contents
of the query. here's the direct case:
this could also be quantized to
SELECT pg_try_advisory_lock ( ? )
but i din't do that.