我在运行一个查询,在一个有13亿行的数据库上出现了"读取超时"的提示。
这并不是一个特别高级的查询,它只是将推文中的标签组合在一起。
这并不是一个特别高级的查询,它只是将推文中的标签组合在一起。
SELECT case when match(hashtag,
'[Cc]orona.*|COVID.*|[Cc]ovid.*|[Cc]oVID_19.*|[Cc]orvid19.*|COVD19.*|CORONA.*|KILLTHEVI.*|SARSCoV.*|ChineseVi.*|WuhanVir.*|ChinaVir.*|[Vv]irus.*|
[Qq]uarantine|[Pp]andemic.*|[Cc]linical[Tt]rial.*|FlattenTheCurve.*|SocialDistancing.*|StayHome.*|StayTheFHome.*|StayAtHome.*|stopthespread.*|
SafeHands.*|WashYourHands.*|SelfIsolation.*') then 'COVID19'
when match(hashtag, '[Jj]anta[Cc]urfew.*|[Jj]anata[Cc]urfew.*') then 'JantaCurfew'
when match(hashtag, 'Bhula.*') then 'Bhula'
when match(hashtag, '[Ss]t[Pp]atrick.*|HappyStPatrick') then 'StPatricks day'
when match(hashtag, '[Cc]hina.*') then 'China'
when match(hashtag, '[Ii]taly.*') then 'Italy'
when match(hashtag, '[Ii]ran.*') then 'Iran'
when match(hashtag, '[Ii]ndia.*') then 'India'
when match(hashtag, '[Hh]appy[Mm]others[Dd]ay.*|[Mm]others[Dd]ay.*') then 'MothersDay'
else hashtag END
as Hashtag,
SUM(CASE WHEN created >= '2020-05-14 00:00:00' AND created <= '2020-03-14 23:59:59' THEN 1 END) "May 14th'20",
SUM(CASE WHEN created >= '2020-05-13 00:00:00' AND created <= '2020-03-13 23:59:59' THEN 1 END) "May 13th'20",
SUM(CASE WHEN created >= '2020-05-12 00:00:00' AND created <= '2020-03-12 23:59:59' THEN 1 END) "May 12th'20"
FROM twitterDBhashtags
group by Hashtag
order by "May 12th'20" DESC limit 20;
ClickHouse运行在条带化的硬盘上,并通过千兆网络进行访问。
如果超时是挑战的话,如何才能更改超时时间以获得更多时间呢?
如果可能的话,我非常想能够运行长达数分钟的查询而不会收到“读取超时”消息。