File size: 928 Bytes
c27e67a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
CREATE OR REPLACE DICTIONARY sessions_dict
<%= if @cluster? do %>ON CLUSTER '{cluster}'<% end %>
(
    site_id UInt64,
    session_id UInt64,
    referrer String,
    referrer_source String,
    utm_medium String,
    utm_source String,
    utm_campaign String,
    utm_content String,
    utm_term String,
    country_code String,
    subdivision1_code String,
    subdivision2_code String,
    city_geoname_id UInt32,
    screen_size String,
    operating_system String,
    operating_system_version String,
    browser String,
    browser_version String
)
PRIMARY KEY site_id, session_id
SOURCE(CLICKHOUSE(TABLE sessions_v2 <%= @dictionary_connection_params %>))
LIFETIME(<%= @dictionary_config.lifetime %>)
LAYOUT(
    complex_key_cache(
        size_in_cells <%= @dictionary_config.size_in_cells %>
        max_threads_for_updates <%= @dictionary_config.max_threads_for_updates %>
        allow_read_expired_keys 1
    )
)