10 Commits

Author SHA1 Message Date
Joshua Lockerman
20ec6914c0 Add license headers to SQL files and test code 2018-10-29 13:28:19 -04:00
Rob Kiefer
67a8a41e22 Make chunk identifiers formatting safe using format 2018-07-11 11:54:33 -04:00
Rob Kiefer
41af6ff3ae Fix misreported toast_size in chunk_relation_size funcs
A bug in the SQL for getting the size of chunks would use the
TOAST size of the main/dummy table as the toast size for the
chunks rather than each chunks' own toast size.
2018-07-11 11:54:33 -04:00
Narek Galstyan
4b4211fe94 Fix some external functions when setting a custom schema
Make sure internal references to timescale functions use the correct schema to refer to these functions. Fixes #554
2018-06-19 10:15:19 -04:00
Rob Kiefer
c660fcd8ff Add hypertable_approximate_row_count convenience function
Getting an approximate row count for a hypertable involves getting
estimates for all of its chunks rather than just looking up a
single value in the catalog tables. This PR provides a convenience
function for doing the JOINs/summing.
2018-05-18 10:21:43 -04:00
Matvey Arye
a4e1e32d02 Change range_start and range_end semantics
We now use INT64_MAX and INT64_MIN as the max and min values for
dimension_slice ranges. If a dimension_slice has a range_start of
INT64_MIN or the range_end is INT64_MAX, we remove the corresponding
check constraint on the chunk since it signifies that this end of the
range is infinite. Closed ranges now always have INT64_MIN as range_end
of first slice and range_end of INT64_MAX for the last slice.
Also, points corresponding to INT64_MAX are always
put in the same slice as INT64_MAX-1 to avoid problems with the
semantics that coordinate < range_end.
2017-11-14 08:00:10 -08:00
Erik Nordström
097db3d589 Refactor chunk index handling
This change refactors the chunk index handling to make better use
of standard PostgreSQL catalog information, while removing the
hypertable_index metadata table and associated triggers, including
those on the chunk_index table. The chunk_index table itself is
also simplified.

A benefit of this refactoring is that indexes are no longer
created using string mangling to construct the CREATE INDEX command
for a chunk, based on the string definition of the hypertable
index. Instead, indexes are created in C using proper index-related
internal data structures.

Chunk indexes can now also be renamed and are added in the parent
index tablespace. Changing tablespace on a hypertable index also
recurses to chunks, as expected. Default indexes that are added when
creating a hypertable use the hypertable's tablespace.

Creating Hypertable indexes with the CONCURRENTLY modifier is
currently blocked, due to unclear semantics regarding concurrent
creation over many tables, including how to deal with snapshots.
2017-10-03 10:51:32 +02:00
Olof Rensfelt
8cf8d3c377 Improve the size utils functions.
The hypertable, chunk, and index size functions are
now split into main function and a corresponding ´pretty´
function. In chunk_relation_size_pretty() the ranges are
now converted into a human readable form when they are time types.
2017-09-16 09:53:08 +02:00
Olof Rensfelt
0137c92cdb Fix output order of chunk dimensions and ranges in chunk_relation_size. 2017-08-24 11:14:52 +02:00
Olof Rensfelt
e0eeeb9bdb Add hypertable, chunk, and indexes size utils functions. 2017-07-13 14:14:40 +02:00