CREATE TABLE "log_entries" (
        "request_time" timestamp with time zone,
        "seconds_to_serve" integer,
        "response_code" integer,
        "bytes_sent" integer,
        "request_type" character varying(10),
        "virtual_domain" character varying(80),
	"remote_host" character varying(80),
        "request_url_path" character varying(80),
        "referer" text,
        "user_agent" text,
        "request" text,
        "logname" character varying(30),
        "username" character varying(30)
);


CREATE TABLE "temp_entries" (
        "request_time" timestamp with time zone,
        "seconds_to_serve" integer,
        "response_code" integer,
        "bytes_sent" integer,
        "request_type" character varying(10),
        "virtual_domain" character varying(80),
	"remote_host" character varying(80),
        "request_url_path" character varying(80),
        "referer" text,
        "user_agent" text,
        "request" text,
        "logname" character varying(30),
        "username" character varying(30)
);

CREATE  INDEX "temp_entries_requesttime" on "temp_entries" using btree ( "request_time" "timestamp_ops" );
CREATE  INDEX "temp_entries_responsecode" on "temp_entries" using btree ( "response_code" "int4_ops" );
CREATE  INDEX "temp_entries_virtualdomain" on "temp_entries" using btree ( "virtual_domain" "varchar_ops" );
CREATE  INDEX "temp_entries_remotehost" on "temp_entries" using btree ( "remote_host" "varchar_ops" );


CREATE TABLE "full_entries" (
	"request_time" timestamp with time zone,
	"seconds_to_serve" integer,
	"response_code" integer,
	"bytes_sent" integer,
	"request_type" character varying(10),
	"virtual_domain" character varying(80),
	"remote_host" character varying(80),
	"host_type" character varying(3),
	"request_url_path" text,
	"referer" text,
	"referer_domain" character varying(80),
	"referer_sengine" character varying(80),
	"user_agent" text,
	"request" text,
	"logname" character varying(30),
	"username" character varying(30)
);

CREATE  INDEX "full_entries_requesttime" on "full_entries" using btree ( "request_time" "timestamp_ops" );
CREATE  INDEX "full_entries_responsecode" on "full_entries" using btree ( "response_code" "int4_ops" );
CREATE  INDEX "full_entries_requesttype" on "full_entries" using btree ( "request_type" "varchar_ops" );
CREATE  INDEX "full_entries_virtualdomain" on "full_entries" using btree ( "virtual_domain" "varchar_ops" );
CREATE  INDEX "full_entries_remotehost" on "full_entries" using btree ( "remote_host" "varchar_ops" );
CREATE  INDEX "full_entries_refdomain" on "full_entries" using btree ( "referer_domain" "varchar_ops" );
CREATE  INDEX "full_entries_sengine" on "full_entries" using btree ( "referer_sengine" "varchar_ops" );
