Skip to content

Commit

Permalink
imlCopy: add bytes_size
Browse files Browse the repository at this point in the history
Signed-off-by: qGYdXbY2 <[email protected]>
  • Loading branch information
qGYdXbY2 committed Apr 2, 2024
1 parent 571f803 commit 1260bef
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ CASE WHEN edata.id isnull THEN max_bigint() ELSE ${{pseudoNextVersion}} END as n
FROM
(${{contentQuery}} ) idata
LEFT JOIN ${schema}.${table} edata ON (idata.id = edata.id AND edata.next_version = max_bigint())
RETURNING id, version
RETURNING id, version, (coalesce(pg_column_size(jsondata),0) + coalesce(pg_column_size(geo),0))::bigint as bytes_size
),
upd_data as
(UPDATE ${schema}.${table}
Expand All @@ -120,7 +120,7 @@ AND id IN (SELECT id FROM ins_data)
AND version < (SELECT version FROM ins_data LIMIT 1)
RETURNING id, version
)
SELECT count(1) AS rows_uploaded, 0::BIGINT AS bytes_uploaded, 0::BIGINT AS files_uploaded,
SELECT count(1) AS rows_uploaded, sum(bytes_size)::BIGINT AS bytes_uploaded, 0::BIGINT AS files_uploaded,
(SELECT count(1) FROM upd_data) AS version_updated,
(SELECT count(1) FROM del_data) AS version_deleted
FROM ins_data l
Expand Down

0 comments on commit 1260bef

Please sign in to comment.