Skip to content
代码片段 群组 项目
提交 4616841c 编辑于 作者: Adam Hegyi's avatar Adam Hegyi
浏览文件

Use ALTER TABLE when deleting records form CH

上级 f8bbb505
No related branches found
No related tags found
无相关合并请求
......@@ -83,13 +83,13 @@ def delete_records_from_click_house(id_paths)
paths = id_paths.map(&:second).map { |value| "'#{value}'" }.join(',')
query = ClickHouse::Client::Query.new(
raw_query: "DELETE FROM events WHERE path IN (#{paths})"
raw_query: "ALTER TABLE events DELETE WHERE path IN (#{paths})"
)
connection.execute(query)
query = ClickHouse::Client::Query.new(
raw_query: 'DELETE FROM event_namespace_paths WHERE namespace_id IN ({namespace_ids:Array(UInt64)})',
raw_query: 'ALTER TABLE event_namespace_paths DELETE WHERE namespace_id IN ({namespace_ids:Array(UInt64)})',
placeholders: { namespace_ids: id_paths.map(&:first).to_json }
)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册