2013-08-29 11:56:37 +00:00
|
|
|
\timing
|
|
|
|
|
2015-03-30 05:50:13 +00:00
|
|
|
create table hits_10m
|
2013-08-22 13:14:35 +00:00
|
|
|
(
|
|
|
|
WatchID INTEGER,
|
|
|
|
JavaEnable INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
Title VARCHAR(1024),
|
2013-08-22 13:14:35 +00:00
|
|
|
GoodEvent INTEGER,
|
|
|
|
EventTime DATETIME,
|
|
|
|
EventDate DATE,
|
|
|
|
CounterID INTEGER,
|
|
|
|
ClientIP INTEGER,
|
|
|
|
RegionID INTEGER,
|
|
|
|
UserID INTEGER,
|
|
|
|
CounterClass INTEGER,
|
|
|
|
OS INTEGER,
|
|
|
|
UserAgent INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
URL VARCHAR(6072),
|
|
|
|
Referer VARCHAR(2048),
|
2013-08-22 13:14:35 +00:00
|
|
|
Refresh INTEGER,
|
|
|
|
RefererCategoryID INTEGER,
|
|
|
|
RefererRegionID INTEGER,
|
|
|
|
URLCategoryID INTEGER,
|
|
|
|
URLRegionID INTEGER,
|
|
|
|
ResolutionWidth INTEGER,
|
|
|
|
ResolutionHeight INTEGER,
|
|
|
|
ResolutionDepth INTEGER,
|
|
|
|
FlashMajor INTEGER,
|
|
|
|
FlashMinor INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
FlashMinor2 VARCHAR(256),
|
2013-08-22 13:14:35 +00:00
|
|
|
NetMajor INTEGER,
|
|
|
|
NetMinor INTEGER,
|
|
|
|
UserAgentMajor INTEGER,
|
|
|
|
UserAgentMinor CHAR(2),
|
|
|
|
CookieEnable INTEGER,
|
|
|
|
JavascriptEnable INTEGER,
|
|
|
|
IsMobile INTEGER,
|
|
|
|
MobilePhone INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
MobilePhoneModel VARCHAR(80),
|
|
|
|
Params VARCHAR(2048),
|
2013-08-22 13:14:35 +00:00
|
|
|
IPNetworkID INTEGER,
|
|
|
|
TraficSourceID INTEGER,
|
|
|
|
SearchEngineID INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
SearchPhrase VARCHAR(1024),
|
2013-08-22 13:14:35 +00:00
|
|
|
AdvEngineID INTEGER,
|
|
|
|
IsArtifical INTEGER,
|
|
|
|
WindowClientWidth INTEGER,
|
|
|
|
WindowClientHeight INTEGER,
|
|
|
|
ClientTimeZone INTEGER,
|
|
|
|
ClientEventTime DATETIME,
|
|
|
|
SilverlightVersion1 INTEGER,
|
|
|
|
SilverlightVersion2 INTEGER,
|
|
|
|
SilverlightVersion3 INTEGER,
|
|
|
|
SilverlightVersion4 INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
PageCharset VARCHAR(80),
|
2013-08-22 13:14:35 +00:00
|
|
|
CodeVersion INTEGER,
|
|
|
|
IsLink INTEGER,
|
|
|
|
IsDownload INTEGER,
|
|
|
|
IsNotBounce INTEGER,
|
|
|
|
FUniqID INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
OriginalURL VARCHAR(6072),
|
2013-08-22 13:14:35 +00:00
|
|
|
HID INTEGER,
|
|
|
|
IsOldCounter INTEGER,
|
|
|
|
IsEvent INTEGER,
|
|
|
|
IsParameter INTEGER,
|
|
|
|
DontCountHits INTEGER,
|
|
|
|
WithHash INTEGER,
|
|
|
|
HitColor CHAR(1),
|
|
|
|
LocalEventTime DATETIME,
|
|
|
|
Age INTEGER,
|
|
|
|
Sex INTEGER,
|
|
|
|
Income INTEGER,
|
|
|
|
Interests INTEGER,
|
|
|
|
Robotness INTEGER,
|
|
|
|
RemoteIP INTEGER,
|
|
|
|
WindowName INTEGER,
|
|
|
|
OpenerName INTEGER,
|
|
|
|
HistoryLength INTEGER,
|
|
|
|
BrowserLanguage CHAR(2),
|
|
|
|
BrowserCountry CHAR(2),
|
|
|
|
SocialNetwork VARCHAR(128),
|
|
|
|
SocialAction VARCHAR(128),
|
|
|
|
HTTPError INTEGER,
|
|
|
|
SendTiming INTEGER,
|
|
|
|
DNSTiming INTEGER,
|
|
|
|
ConnectTiming INTEGER,
|
|
|
|
ResponseStartTiming INTEGER,
|
|
|
|
ResponseEndTiming INTEGER,
|
|
|
|
FetchTiming INTEGER,
|
|
|
|
SocialSourceNetworkID INTEGER,
|
|
|
|
SocialSourcePage VARCHAR(128),
|
|
|
|
ParamPrice INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
ParamOrderID VARCHAR(80),
|
2013-08-22 13:14:35 +00:00
|
|
|
ParamCurrency CHAR(3),
|
|
|
|
ParamCurrencyID INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
OpenstatServiceName VARCHAR(80),
|
|
|
|
OpenstatCampaignID VARCHAR(80),
|
|
|
|
OpenstatAdID VARCHAR(80),
|
|
|
|
OpenstatSourceID VARCHAR(80),
|
|
|
|
UTMSource VARCHAR(256),
|
|
|
|
UTMMedium VARCHAR(256),
|
|
|
|
UTMCampaign VARCHAR(256),
|
|
|
|
UTMContent VARCHAR(256),
|
|
|
|
UTMTerm VARCHAR(256),
|
|
|
|
FromTag VARCHAR(256),
|
2013-08-22 13:14:35 +00:00
|
|
|
HasGCLID INTEGER,
|
|
|
|
RefererHash INTEGER,
|
|
|
|
URLHash INTEGER,
|
2015-03-30 05:50:13 +00:00
|
|
|
CLID INTEGER
|
|
|
|
) ORDER BY CounterID, EventDate, UserID, EventTime;
|
2013-08-22 13:14:35 +00:00
|
|
|
|
2015-03-30 05:50:13 +00:00
|
|
|
\set input_file '''/opt/dumps/hits_10m_corrected.tsv'''
|
|
|
|
COPY hits_10m FROM :input_file DELIMITER E'\t' DIRECT;
|
2013-08-22 13:14:35 +00:00
|
|
|
|
|
|
|
|
2015-03-30 05:50:13 +00:00
|
|
|
create table hits_100m
|
2013-08-22 13:14:35 +00:00
|
|
|
(
|
|
|
|
WatchID INTEGER,
|
|
|
|
JavaEnable INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
Title VARCHAR(1024),
|
2013-08-22 13:14:35 +00:00
|
|
|
GoodEvent INTEGER,
|
|
|
|
EventTime DATETIME,
|
|
|
|
EventDate DATE,
|
|
|
|
CounterID INTEGER,
|
|
|
|
ClientIP INTEGER,
|
|
|
|
RegionID INTEGER,
|
|
|
|
UserID INTEGER,
|
|
|
|
CounterClass INTEGER,
|
|
|
|
OS INTEGER,
|
|
|
|
UserAgent INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
URL VARCHAR(6072),
|
|
|
|
Referer VARCHAR(2048),
|
2013-08-22 13:14:35 +00:00
|
|
|
Refresh INTEGER,
|
|
|
|
RefererCategoryID INTEGER,
|
|
|
|
RefererRegionID INTEGER,
|
|
|
|
URLCategoryID INTEGER,
|
|
|
|
URLRegionID INTEGER,
|
|
|
|
ResolutionWidth INTEGER,
|
|
|
|
ResolutionHeight INTEGER,
|
|
|
|
ResolutionDepth INTEGER,
|
|
|
|
FlashMajor INTEGER,
|
|
|
|
FlashMinor INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
FlashMinor2 VARCHAR(256),
|
2013-08-22 13:14:35 +00:00
|
|
|
NetMajor INTEGER,
|
|
|
|
NetMinor INTEGER,
|
|
|
|
UserAgentMajor INTEGER,
|
|
|
|
UserAgentMinor CHAR(2),
|
|
|
|
CookieEnable INTEGER,
|
|
|
|
JavascriptEnable INTEGER,
|
|
|
|
IsMobile INTEGER,
|
|
|
|
MobilePhone INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
MobilePhoneModel VARCHAR(80),
|
|
|
|
Params VARCHAR(2048),
|
2013-08-22 13:14:35 +00:00
|
|
|
IPNetworkID INTEGER,
|
|
|
|
TraficSourceID INTEGER,
|
|
|
|
SearchEngineID INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
SearchPhrase VARCHAR(1024),
|
2013-08-22 13:14:35 +00:00
|
|
|
AdvEngineID INTEGER,
|
|
|
|
IsArtifical INTEGER,
|
|
|
|
WindowClientWidth INTEGER,
|
|
|
|
WindowClientHeight INTEGER,
|
|
|
|
ClientTimeZone INTEGER,
|
|
|
|
ClientEventTime DATETIME,
|
|
|
|
SilverlightVersion1 INTEGER,
|
|
|
|
SilverlightVersion2 INTEGER,
|
|
|
|
SilverlightVersion3 INTEGER,
|
|
|
|
SilverlightVersion4 INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
PageCharset VARCHAR(80),
|
2013-08-22 13:14:35 +00:00
|
|
|
CodeVersion INTEGER,
|
|
|
|
IsLink INTEGER,
|
|
|
|
IsDownload INTEGER,
|
|
|
|
IsNotBounce INTEGER,
|
|
|
|
FUniqID INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
OriginalURL VARCHAR(6072),
|
2013-08-22 13:14:35 +00:00
|
|
|
HID INTEGER,
|
|
|
|
IsOldCounter INTEGER,
|
|
|
|
IsEvent INTEGER,
|
|
|
|
IsParameter INTEGER,
|
|
|
|
DontCountHits INTEGER,
|
|
|
|
WithHash INTEGER,
|
|
|
|
HitColor CHAR(1),
|
|
|
|
LocalEventTime DATETIME,
|
|
|
|
Age INTEGER,
|
|
|
|
Sex INTEGER,
|
|
|
|
Income INTEGER,
|
|
|
|
Interests INTEGER,
|
|
|
|
Robotness INTEGER,
|
|
|
|
RemoteIP INTEGER,
|
|
|
|
WindowName INTEGER,
|
|
|
|
OpenerName INTEGER,
|
|
|
|
HistoryLength INTEGER,
|
|
|
|
BrowserLanguage CHAR(2),
|
|
|
|
BrowserCountry CHAR(2),
|
|
|
|
SocialNetwork VARCHAR(128),
|
|
|
|
SocialAction VARCHAR(128),
|
|
|
|
HTTPError INTEGER,
|
|
|
|
SendTiming INTEGER,
|
|
|
|
DNSTiming INTEGER,
|
|
|
|
ConnectTiming INTEGER,
|
|
|
|
ResponseStartTiming INTEGER,
|
|
|
|
ResponseEndTiming INTEGER,
|
|
|
|
FetchTiming INTEGER,
|
|
|
|
SocialSourceNetworkID INTEGER,
|
|
|
|
SocialSourcePage VARCHAR(128),
|
|
|
|
ParamPrice INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
ParamOrderID VARCHAR(80),
|
2013-08-22 13:14:35 +00:00
|
|
|
ParamCurrency CHAR(3),
|
|
|
|
ParamCurrencyID INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
OpenstatServiceName VARCHAR(80),
|
|
|
|
OpenstatCampaignID VARCHAR(80),
|
|
|
|
OpenstatAdID VARCHAR(80),
|
|
|
|
OpenstatSourceID VARCHAR(80),
|
|
|
|
UTMSource VARCHAR(256),
|
|
|
|
UTMMedium VARCHAR(256),
|
|
|
|
UTMCampaign VARCHAR(256),
|
|
|
|
UTMContent VARCHAR(256),
|
|
|
|
UTMTerm VARCHAR(256),
|
|
|
|
FromTag VARCHAR(256),
|
2013-08-22 13:14:35 +00:00
|
|
|
HasGCLID INTEGER,
|
|
|
|
RefererHash INTEGER,
|
|
|
|
URLHash INTEGER,
|
2015-03-30 05:50:13 +00:00
|
|
|
CLID INTEGER
|
|
|
|
) ORDER BY CounterID, EventDate, UserID, EventTime;
|
2013-08-29 11:56:37 +00:00
|
|
|
|
2015-03-30 05:50:13 +00:00
|
|
|
\set input_file '''/opt/dumps/hits_100m_corrected.tsv'''
|
|
|
|
COPY hits_100m FROM :input_file DELIMITER E'\t' DIRECT;
|
2013-08-29 11:56:37 +00:00
|
|
|
|
|
|
|
|
2015-03-30 05:50:13 +00:00
|
|
|
create table hits_1000m
|
2013-08-22 13:14:35 +00:00
|
|
|
(
|
|
|
|
WatchID INTEGER,
|
|
|
|
JavaEnable INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
Title VARCHAR(1024),
|
2013-08-22 13:14:35 +00:00
|
|
|
GoodEvent INTEGER,
|
|
|
|
EventTime DATETIME,
|
|
|
|
EventDate DATE,
|
|
|
|
CounterID INTEGER,
|
|
|
|
ClientIP INTEGER,
|
|
|
|
RegionID INTEGER,
|
|
|
|
UserID INTEGER,
|
|
|
|
CounterClass INTEGER,
|
|
|
|
OS INTEGER,
|
|
|
|
UserAgent INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
URL VARCHAR(6072),
|
|
|
|
Referer VARCHAR(2048),
|
2013-08-22 13:14:35 +00:00
|
|
|
Refresh INTEGER,
|
|
|
|
RefererCategoryID INTEGER,
|
|
|
|
RefererRegionID INTEGER,
|
|
|
|
URLCategoryID INTEGER,
|
|
|
|
URLRegionID INTEGER,
|
|
|
|
ResolutionWidth INTEGER,
|
|
|
|
ResolutionHeight INTEGER,
|
|
|
|
ResolutionDepth INTEGER,
|
|
|
|
FlashMajor INTEGER,
|
|
|
|
FlashMinor INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
FlashMinor2 VARCHAR(256),
|
2013-08-22 13:14:35 +00:00
|
|
|
NetMajor INTEGER,
|
|
|
|
NetMinor INTEGER,
|
|
|
|
UserAgentMajor INTEGER,
|
|
|
|
UserAgentMinor CHAR(2),
|
|
|
|
CookieEnable INTEGER,
|
|
|
|
JavascriptEnable INTEGER,
|
|
|
|
IsMobile INTEGER,
|
|
|
|
MobilePhone INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
MobilePhoneModel VARCHAR(80),
|
|
|
|
Params VARCHAR(2048),
|
2013-08-22 13:14:35 +00:00
|
|
|
IPNetworkID INTEGER,
|
|
|
|
TraficSourceID INTEGER,
|
|
|
|
SearchEngineID INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
SearchPhrase VARCHAR(1024),
|
2013-08-22 13:14:35 +00:00
|
|
|
AdvEngineID INTEGER,
|
|
|
|
IsArtifical INTEGER,
|
|
|
|
WindowClientWidth INTEGER,
|
|
|
|
WindowClientHeight INTEGER,
|
|
|
|
ClientTimeZone INTEGER,
|
|
|
|
ClientEventTime DATETIME,
|
|
|
|
SilverlightVersion1 INTEGER,
|
|
|
|
SilverlightVersion2 INTEGER,
|
|
|
|
SilverlightVersion3 INTEGER,
|
|
|
|
SilverlightVersion4 INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
PageCharset VARCHAR(80),
|
2013-08-22 13:14:35 +00:00
|
|
|
CodeVersion INTEGER,
|
|
|
|
IsLink INTEGER,
|
|
|
|
IsDownload INTEGER,
|
|
|
|
IsNotBounce INTEGER,
|
|
|
|
FUniqID INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
OriginalURL VARCHAR(6072),
|
2013-08-22 13:14:35 +00:00
|
|
|
HID INTEGER,
|
|
|
|
IsOldCounter INTEGER,
|
|
|
|
IsEvent INTEGER,
|
|
|
|
IsParameter INTEGER,
|
|
|
|
DontCountHits INTEGER,
|
|
|
|
WithHash INTEGER,
|
|
|
|
HitColor CHAR(1),
|
|
|
|
LocalEventTime DATETIME,
|
|
|
|
Age INTEGER,
|
|
|
|
Sex INTEGER,
|
|
|
|
Income INTEGER,
|
|
|
|
Interests INTEGER,
|
|
|
|
Robotness INTEGER,
|
|
|
|
RemoteIP INTEGER,
|
|
|
|
WindowName INTEGER,
|
|
|
|
OpenerName INTEGER,
|
|
|
|
HistoryLength INTEGER,
|
|
|
|
BrowserLanguage CHAR(2),
|
|
|
|
BrowserCountry CHAR(2),
|
|
|
|
SocialNetwork VARCHAR(128),
|
|
|
|
SocialAction VARCHAR(128),
|
|
|
|
HTTPError INTEGER,
|
|
|
|
SendTiming INTEGER,
|
|
|
|
DNSTiming INTEGER,
|
|
|
|
ConnectTiming INTEGER,
|
|
|
|
ResponseStartTiming INTEGER,
|
|
|
|
ResponseEndTiming INTEGER,
|
|
|
|
FetchTiming INTEGER,
|
|
|
|
SocialSourceNetworkID INTEGER,
|
|
|
|
SocialSourcePage VARCHAR(128),
|
|
|
|
ParamPrice INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
ParamOrderID VARCHAR(80),
|
2013-08-22 13:14:35 +00:00
|
|
|
ParamCurrency CHAR(3),
|
|
|
|
ParamCurrencyID INTEGER,
|
2013-08-29 11:56:37 +00:00
|
|
|
OpenstatServiceName VARCHAR(80),
|
|
|
|
OpenstatCampaignID VARCHAR(80),
|
|
|
|
OpenstatAdID VARCHAR(80),
|
|
|
|
OpenstatSourceID VARCHAR(80),
|
|
|
|
UTMSource VARCHAR(256),
|
|
|
|
UTMMedium VARCHAR(256),
|
|
|
|
UTMCampaign VARCHAR(256),
|
|
|
|
UTMContent VARCHAR(256),
|
|
|
|
UTMTerm VARCHAR(256),
|
|
|
|
FromTag VARCHAR(256),
|
2013-08-22 13:14:35 +00:00
|
|
|
HasGCLID INTEGER,
|
|
|
|
RefererHash INTEGER,
|
|
|
|
URLHash INTEGER,
|
2015-03-30 05:50:13 +00:00
|
|
|
CLID INTEGER
|
|
|
|
) ORDER BY CounterID, EventDate, UserID, EventTime;
|
2013-08-22 13:14:35 +00:00
|
|
|
|
2015-03-30 05:50:13 +00:00
|
|
|
\set input_file '''/opt/dumps/hits_1000m_corrected.tsv'''
|
|
|
|
COPY hits_1000m FROM :input_file DELIMITER E'\t' DIRECT;
|