339 Commits

Author SHA1 Message Date
Erik Nordström
9c8e40fbcf Merged in enordstr/backend-database/enordstr/cleanup-tests (pull request #136)
Cleanup tests and make errors less verbose

Approved-by: RobAtticus NA <rob.kiefer@gmail.com>
Approved-by: ci-vast
2017-03-24 07:14:14 +00:00
Erik Nordström
9023de61db Cleanup tests and make errors less verbose
Previously, each test set their own (although mostly the same)
configuration for log output and error verbosity. This is now set
globally in the test runner so that tests only need to set these
configuration parameters if they need to override the defaults.  The
log verbosity is also reduced so that errors aren't generated with the
line number of the source file that output the error. Line numbers in
the output can break tests when upgrading to a new PostgreSQL version
that outputs a different line number.
2017-03-23 22:56:03 +01:00
Rob Kiefer
3fd8bdbd71 Update Docker to use PostgreSQL 9.6.2 2017-03-22 19:38:39 -04:00
Rob Kiefer
5f5a49dffb Release 0.0.4-beta 0.0.4-beta 2017-03-22 18:57:11 -04:00
Rob Kiefer
4c050ad815 Update sample queries' results for datasets 2017-03-22 18:56:00 -04:00
Erik Nordström
2fb71768a3 Merged in enordstr/backend-database/enordstr/fix-drop-extension (pull request #131)
Fix DROP EXTENSION

Approved-by: Matvey Arye <cevian@gmail.com>
Approved-by: ci-vast
2017-03-22 18:49:46 +00:00
Erik Nordström
c60b08e83a Fix DROP EXTENSION
DROP EXTENSION didn't properly reset caches and other saved state
causing various errors related to bad state when the extension was
dropped and/or recreated later.

This patch adds functionality to track the state of the extension and
also signals DROP EXTENSION to other backends that might be running,
allowing them to reset their internal extension state.
2017-03-22 19:43:40 +01:00
RobAtticus NA
643cba1dd2 Merged in check-postgres (pull request #134)
Update Makefile to check for proper PostgreSQL version

Approved-by: Matvey Arye <cevian@gmail.com>
Approved-by: ci-vast
2017-03-22 17:04:47 +00:00
Rob Kiefer
c45e1e1f2c Update Makefile to check for proper PostgreSQL version 2017-03-22 12:11:23 -04:00
enordstr NA
e4928c0835 Merged in enordstr/backend-database/enordstr/cleanup-insert-state-on-error (pull request #133)
Cleanup insert state on error

Approved-by: RobAtticus NA <rob.kiefer@gmail.com>
Approved-by: Matvey Arye <cevian@gmail.com>
Approved-by: ci-vast
2017-03-22 14:32:37 +00:00
Erik Nordström
473d743927 Cleanup insert state on error
If an error is generated in any of the insert triggers, the insert
state kept during a batch insert might be left in an undefined state,
breaking the next insert. This patch makes sure errors are captured in
the insert triggers so that the state can be cleaned up.
2017-03-22 15:20:45 +01:00
RobAtticus NA
cdfa8bd946 Merged in default-port-fix (pull request #132)
Rename setup_db() and fix port for local connections

Approved-by: Matvey Arye <cevian@gmail.com>
Approved-by: Olof Rensfelt <olof@iobeam.com>
Approved-by: ci-vast
2017-03-22 14:11:26 +00:00
Rob Kiefer
cb90eef350 Rename setup_db() and fix port for local connections
If a user attempts to setup a database while not connecting using
the network, port is NULL and thus fails constraint checks. Instead,
we now use the default Postgres port of 5432 when this happens.

Also, setup_db() is renamed to setup_timescaledb() for clarity in
the presence of other extensions.
2017-03-22 09:26:03 -04:00
enordstr NA
b2682a7b57 Merged in enordstr/backend-database/enordstr/cache-stats-and-cleanup (pull request #130)
Add cache statistics and do minor cleanup

Approved-by: Matvey Arye <cevian@gmail.com>
Approved-by: ci-vast
Approved-by: Olof Rensfelt <olof@iobeam.com>
2017-03-22 09:42:17 +00:00
Erik Nordström
89692c9761 Add cache statistics and do minor cleanup
Track statistics for cache hits and misses in the cache module.
Currently not exposed to SQL, but might be useful for internal
debugging.
2017-03-22 09:57:44 +01:00
Matvey Arye
9ef0e6c900 Merged in add-sql-query-test (pull request #129)
Add query tests for ORDER BY time DESC queries LIMIT queries

Approved-by: ci-vast
Approved-by: enordstr NA <erik.nordstrom@gmail.com>
Approved-by: Olof Rensfelt <olof@iobeam.com>
2017-03-21 15:37:36 +00:00
Matvey Arye
e0d63e915c Add query tests for ORDER BY time DESC queries LIMIT queries
These tests show that non-aggregated queries that have an ORDER BY time
DESC LIMIT x structure perform well. Postgres processes such queries by
using a time DESC index and then performs a MergeAppend. Some further
optimization to avoid touching unnecessary tables due to constraints
can be added but they are not a priority. Much worse is that these
optimizations do not work when grouping by time (either through
integer division or using date_trunc).

In order to use the non-aggregated query optimizations we had
to create an index with time as the leading field and no
WHERE clause on the index.
2017-03-21 11:36:47 -04:00
Solar Olugebefola
b32c3789cf Merged in device-to-location (pull request #128) 2017-03-21 15:29:37 +00:00
Solar Olugebefola
03e4618bf0 Change 'device_id' to 'location_id' 2017-03-21 11:28:04 -04:00
Rob Kiefer
f66ae0a8a7 Add build status image to top of README 2017-03-16 18:39:31 -04:00
Rob Kiefer
5e01e150a1 Add travis build file 2017-03-16 18:27:28 -04:00
Rob Kiefer
20d1cc46de Clarify limitation for user triggers on hypertables 2017-03-16 16:47:21 -04:00
enordstr NA
1b92de0f47 Merged in enordstr/backend-database/enordstr/move-typedefs-script (pull request #125)
Move generate_typedef.sh to scripts directory

Approved-by: Olof Rensfelt
Approved-by: ci-vast
2017-03-16 09:58:47 +00:00
Erik Nordström
b4c9055184 Move generate_typedef.sh to scripts directory 2017-03-16 10:48:21 +01:00
enordstr NA
267a38238b Merged in enordstr/backend-database/enordstr/add-depfiles-to-gitignore (pull request #126)
Add dependency files to .gitignore

Approved-by: Olof Rensfelt
Approved-by: ci-vast
2017-03-16 09:47:46 +00:00
Erik Nordström
f6adb5da65 Add dependency files to .gitignore 2017-03-16 10:17:16 +01:00
enordstr NA
b2b33875d0 Merged in enordstr/backend-database/enordstr/header-dependencies (pull request #121)
Generate object dependencies to force 'make' to recompile on changes to headers

Approved-by: Matvey Arye
Approved-by: Olof Rensfelt
Approved-by: ci-vast
2017-03-16 08:53:41 +00:00
Erik Nordström
e5b489b1ba Generate object dependencies to force 'make' to recompile on changes to headers
Previously, running 'make' did not recompile source files when changes
were made to header files. Now the compiler generates dependency files
that will pick up changes to header files and recompile any source
files that include the updated header.

Also, remove insert.h, which is not needed.
2017-03-16 09:45:36 +01:00
RobAtticus NA
b4d6263709 Merged in docs-link (pull request #124)
Add link to docs site in README

Approved-by: ci-vast
Approved-by: Ajay Kulkarni
2017-03-15 21:46:31 +00:00
Rob Kiefer
cd05cba75c Add link to docs site in README 2017-03-15 15:42:25 -04:00
Ajay Kulkarni
25947958f6 Merged in readme-edits-ajay (pull request #123)
Fix bullets
2017-03-15 17:14:31 +00:00
Ajay Kulkarni
8ae80b1bbe Fix bullets 2017-03-15 10:13:17 -07:00
Ajay Kulkarni
5259a0cc4c Merged in readme-edits-ajay (pull request #122)
Clarify README

Approved-by: ci-vast
Approved-by: Matvey Arye
Approved-by: Solar Olugebefola
2017-03-15 17:10:29 +00:00
Ajay Kulkarni
cb5a5d3bd1 Clarify README 2017-03-15 09:28:24 -07:00
Rob Kiefer
940e0049bc Update README with PostgreSQL version 2017-03-15 10:08:13 -04:00
Matvey Arye
69a2cf23c8 Merged in insert-main (pull request #118)
Make insert operate on main table instead of on root table

Approved-by: enordstr NA
Approved-by: ci-vast
Approved-by: RobAtticus NA
2017-03-14 19:35:42 +00:00
Matvey Arye
e9c554a901 Make insert operate on main table instead of on root table 2017-03-14 12:49:17 -04:00
Matvey Arye
012fe87499 Forbid users from creating custom triggers on hypertables 2017-03-14 09:27:59 -04:00
enordstr NA
01c4cdc0dd Merged in enordstr/backend-database/enordstr/break-up-timescaledb-c (pull request #120)
Break up timescaledb.c

Approved-by: Olof Rensfelt
Approved-by: ci-vast
2017-03-14 13:19:30 +00:00
Erik Nordström
7236b9723b Rename internal planner data types for consistency 2017-03-14 14:08:44 +01:00
Erik Nordström
001c41f84a Rename IobeamLoaded() to extension_is_loaded() 2017-03-14 14:08:39 +01:00
Erik Nordström
aa51e221f3 Break up timescaledb.c into separate source files.
This patch refactors the source code so that a bunch of unrelated code
for the planner, process utilities and transaction management, which
was previously located in the common file timescaledb.c, is now broken
up into separate source files.
2017-03-14 13:50:08 +01:00
Erik Nordström
e641ae4f5c Fix broken comment. 2017-03-14 13:50:08 +01:00
enordstr NA
5f4b158c83 Merged in enordstr/backend-database/enordstr/no-storage-for-negative-cache-entries (pull request #119)
Avoid allocating hypertable cache storage for negative entries.

Approved-by: Olof Rensfelt
Approved-by: ci-vast
2017-03-14 12:37:29 +00:00
Erik Nordström
852ba7ee97 Avoid allocating hypertable cache storage for negative entries.
The hypertable cache stores negative cache entries to speed up checks
for tables that aren't hypertables. However, a full hypertable cache
entry was allocated for these negative entries, thus wasting cache
storage. With this update, the full entry is only allocated for
positive entries that actually represent hypertables.
2017-03-14 13:31:34 +01:00
Erik Nordström
a1da9bf5c5 Fix misleading comment 2017-03-14 10:08:28 +01:00
Rob Kiefer
bffc594d85 Release 0.0.3-beta & fix install script 0.0.3-beta 2017-03-13 20:37:27 -04:00
Rob Kiefer
1e9c215535 Update README with note about upgrades 2017-03-13 15:22:37 -04:00
Rob Kiefer
3e37745dc0 Release 0.0.2-beta (and update build scripts) 0.0.2-beta 2017-03-13 15:17:42 -04:00
Matvey Arye
84d32e2fbe Merged in planner-use-cache (pull request #117)
Make the planner use metadata cache

Approved-by: enordstr NA
Approved-by: ci-vast
2017-03-13 18:30:39 +00:00