perf: change Text queries to ByteString
Improves performance by not utf8 encoding the whole query with encodeUtf8. Only certain parts. It's also a gradual step needed to use the Snippet type from hasql-dynamic-statements.
This commit is contained in:
committed by
Steve Chavez
parent
7e3e19acbb
commit
d1d0c6772a
+1
-1
@@ -68,7 +68,7 @@ exec pool input query =
|
||||
|
||||
explainCost :: SqlQuery -> H.Statement ByteString (Maybe Int64)
|
||||
explainCost query =
|
||||
H.Statement (encodeUtf8 sql) (HE.param $ HE.nonNullable HE.unknown) decodeExplain False
|
||||
H.Statement sql (HE.param $ HE.nonNullable HE.unknown) decodeExplain False
|
||||
where
|
||||
sql = "EXPLAIN (FORMAT JSON) " <> query
|
||||
decodeExplain :: HD.Result (Maybe Int64)
|
||||
|
||||
Reference in New Issue
Block a user