CREATE TABLE hits_10m_words (word String, UserID UInt64) ENGINE Memory
CREATE TABLE strings (short String, long String) ENGINE Memory
INSERT INTO hits_10m_words SELECT DISTINCT arrayJoin(splitByString(' ', SearchPhrase)) AS word, UserID FROM hits_10m_single WHERE length(word) > 0
INSERT INTO strings SELECT toString(rand()) a, a || a || a || a || a || a || a || a || a || a || a || a FROM zeros(1000000)
1
SELECT 1 FROM hits_10m_words WHERE word IN (SELECT word FROM hits_10m_words) FORMAT Null
SELECT 1 FROM strings WHERE short IN (SELECT short FROM strings) FORMAT Null
SELECT 1 FROM strings WHERE long IN (SELECT long FROM strings) FORMAT Null
SELECT 1 FROM strings WHERE short IN (SELECT long FROM strings) FORMAT Null
SELECT 1 FROM strings WHERE long IN (SELECT short FROM strings) FORMAT Null
SELECT 1 FROM hits_10m_words WHERE word IN (SELECT short FROM strings) FORMAT Null
SELECT 1 FROM hits_10m_words WHERE word IN (SELECT long FROM strings) FORMAT Null
DROP TABLE IF EXISTS hits_10m_words
DROP TABLE IF EXISTS strings