File: out_of_order_random_direct.sql

package info (click to toggle)
timescaledb 2.26.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,772 kB
  • sloc: ansic: 60,125; sql: 24,806; sh: 1,896; python: 1,290; perl: 78; makefile: 14
file content (18 lines) | stat: -rw-r--r-- 650 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.

DROP DATABASE IF EXISTS test;
CREATE DATABASE test;
\c test
\timing

DROP EXTENSION IF EXISTS timescaledb CASCADE;
CREATE EXTENSION timescaledb;

SELECT pg_backend_pid();

CREATE TABLE test_hyper (i bigint, j double precision, k bigint, ts timestamp);
SELECT create_hypertable('test_hyper', 'i', chunk_time_interval=>10);

INSERT INTO test_hyper SELECT random()*100, random()*100, x*10, _timescaledb_functions.to_timestamp(x)  FROM generate_series(1,100000000) AS x;