You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let query_sql = if stream_type == StreamType::Index{
// TODO: NOT IN is not efficient, need to optimize it: NOT EXIST
format!(
"SELECT * FROM tbl WHERE file_name NOT IN (SELECT file_name FROM tbl WHERE deleted is True) ORDER BY {} DESC",
"SELECT term, file_name, min(_timestamp) as _timestamp, sum(_count) as _count, deleted FROM tbl WHERE file_name NOT IN (SELECT file_name FROM tbl WHERE deleted is True) GROUP BY term, file_name, deleted ORDER BY {} DESC",