From 5018666cab35ac6246adb7a8622a9041c3b3a4fb Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Mon, 25 Feb 2019 16:34:19 +0100 Subject: [PATCH] Index auf inventory parts_id MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit um schneller die Bestände eines Artikels in diversen Lagern zu berechnen --- sql/Pg-upgrade2/inventory_parts_id_index.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sql/Pg-upgrade2/inventory_parts_id_index.sql diff --git a/sql/Pg-upgrade2/inventory_parts_id_index.sql b/sql/Pg-upgrade2/inventory_parts_id_index.sql new file mode 100644 index 000000000..84ffec933 --- /dev/null +++ b/sql/Pg-upgrade2/inventory_parts_id_index.sql @@ -0,0 +1,12 @@ +-- @tag: inventory_parts_id_index +-- @description: Index auf inventory parts_id, um schneller die Bestände eines Artikels in diversen Lagern zu berechnen +-- @depends: release_3_5_4 + +-- increase speed of queries for inventory information on one part, e.g. + +-- SELECT parts_id, warehouse_id, bin_id, sum(qty) +-- FROM inventory +-- WHERE parts_id = 1234 +-- GROUP BY parts_id, bin_id, warehouse_id; + +CREATE INDEX inventory_parts_id_idx ON inventory (parts_id); -- 2.20.1