diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-07-12 20:37:45 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-07-22 22:57:23 +0300 |
commit | 599bd6335c27ff2c1a48cc0b3a5ee115d49afcda (patch) | |
tree | 073f7a6426fa681f097411aefc913a7f630a394d /libbrep | |
parent | c28758a9327efc0f3bfc2f3c14d12b533750d94b (diff) |
Speed-up builds page loading
Diffstat (limited to 'libbrep')
-rw-r--r-- | libbrep/build-package.hxx | 2 | ||||
-rw-r--r-- | libbrep/build.hxx | 6 | ||||
-rw-r--r-- | libbrep/build.xml | 8 |
3 files changed, 14 insertions, 2 deletions
diff --git a/libbrep/build-package.hxx b/libbrep/build-package.hxx index c491b9e..c288f07 100644 --- a/libbrep/build-package.hxx +++ b/libbrep/build-package.hxx @@ -71,7 +71,7 @@ namespace brep // Foreign object that is mapped to a subset of the package object. // - #pragma db object table("build_package") pointer(shared_ptr) readonly + #pragma db object table("build_package") pointer(shared_ptr) readonly session class build_package { public: diff --git a/libbrep/build.hxx b/libbrep/build.hxx index ea51c00..a8139a8 100644 --- a/libbrep/build.hxx +++ b/libbrep/build.hxx @@ -26,7 +26,7 @@ // #define LIBBREP_BUILD_SCHEMA_VERSION_BASE 7 -#pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 8, closed) +#pragma db model version(LIBBREP_BUILD_SCHEMA_VERSION_BASE, 9, closed) // We have to keep these mappings at the global scope instead of inside // the brep namespace because they need to be also effective in the @@ -242,6 +242,10 @@ namespace brep #pragma db member(toolchain_version) \ set(this.toolchain_version.init (this.id.toolchain_version, (?))) + // Speed-up queries with ordering the result by the timestamp. + // + #pragma db member(timestamp) index + #pragma db member(results) id_column("") value_column("") \ section(results_section) diff --git a/libbrep/build.xml b/libbrep/build.xml index 032fd38..2a621b6 100644 --- a/libbrep/build.xml +++ b/libbrep/build.xml @@ -1,4 +1,12 @@ <changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="pgsql" schema-name="build" version="1"> + <changeset version="9"> + <alter-table name="build"> + <add-index name="build_timestamp_i"> + <column name="timestamp"/> + </add-index> + </alter-table> + </changeset> + <changeset version="8"/> <model version="7"> |