/** Good */
\timing
/** Create GiST index and populate */
CREATE TABLE logs_gist (
    id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
    log_time tstzrange NOT NULL
);
CREATE INDEX logs_log_time_gist_idx ON logs_gist USING gist(log_time);

INSERT INTO logs_gist (log_time)
SELECT
    tstzrange(
        y.start_time + ((x % 1334) || 'hours')::interval,
        y.end_time + ((x % 1334) || 'hours')::interval
    )
FROM generate_series(1, 400000) x,
    LATERAL (
        SELECT z.*
        FROM (
            VALUES
                ('2018-04-01 9:00'::timestamptz, '2018-04-01 12:30'::timestamptz),
                ('2018-04-01 14:00'::timestamptz, '2018-04-01 16:30'::timestamptz),
                ('2018-04-01 19:30'::timestamptz, '2018-04-01 21:00'::timestamptz)

        ) z(start_time, end_time)
    ) y;

/** Create SP-GiST index and populate */
CREATE TABLE logs_spgist (
    id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
    log_time tstzrange NOT NULL
);
CREATE INDEX logs_log_time_spgist_idx ON logs_spgist USING spgist(log_time);

INSERT INTO logs_spgist (log_time)
SELECT
    tstzrange(
        y.start_time + ((x % 1334) || 'hours')::interval,
        y.end_time + ((x % 1334) || 'hours')::interval
    )
FROM generate_series(1, 400000) x,
    LATERAL (
        SELECT z.*
        FROM (
            VALUES
                ('2018-04-01 9:00'::timestamptz, '2018-04-01 12:30'::timestamptz),
                ('2018-04-01 14:00'::timestamptz, '2018-04-01 16:30'::timestamptz),
                ('2018-04-01 19:30'::timestamptz, '2018-04-01 21:00'::timestamptz)

        ) z(start_time, end_time)
    ) y;
