-
Notifications
You must be signed in to change notification settings - Fork 128
Open
Description
SELECT uast_extract(
uast(blob_content, 'csharp', "(//csharp:BinaryExpression_AddExpression/Left/uast:String | //csharp:InterpolatedStringExpression//csharp:InterpolatedStringTextToken[1])[starts-with(normalize-space(@Value), 'SELECT') or starts-with(normalize-space(@Value), 'select') or starts-with(normalize-space(@Value), 'UPDATE') or starts-with(normalize-space(@Value), 'update') or starts-with(normalize-space(@Value), 'DELETE') or starts-with(normalize-space(@Value), 'delete') or starts-with(normalize-space(@Value), 'INSERT') or starts-with(normalize-space(@Value), 'insert') or starts-with(normalize-space(@Value), 'CREATE') or starts-with(normalize-space(@Value), 'create') or starts-with(normalize-space(@Value), 'ALTER') or starts-with(normalize-space(@Value), 'alter') or starts-with(normalize-space(@Value), 'DROP') or starts-with(normalize-space(@Value), 'drop')]"),
'@pos') AS positions,
repository_id,
file_path
FROM (
SELECT f.repository_id,
f.file_path,
b.blob_content
FROM (
SELECT *
FROM refs r
NATURAL JOIN commit_blobs cb
NATURAL JOIN blobs
WHERE r.ref_name = 'HEAD'
AND NOT IS_BINARY(blob_content)
) b
INNER JOIN (
SELECT repository_id, file_path, blob_hash
FROM refs r
NATURAL JOIN commit_files cf
WHERE r.ref_name = 'HEAD'
) f
ON b.blob_hash = f.blob_hash
AND b.repository_id = f.repository_id
WHERE language(f.file_path, b.blob_content) = 'C#'
) t
WHERE positions IS NOT NULLThis could be parallelized adding an exchange over the topmost projection. Instead, we do this serially, causing extremely low performance on queries using uast functions on the topmost projects under certain conditions.
Metadata
Metadata
Assignees
Labels
No labels