Skip to content

Commit

Permalink
fix(indexes): add indexes to trans_id columns
Browse files Browse the repository at this point in the history
Many of our queries use the `trans_id` for convenience .. it's easier than
shipping the record_uuid to/from the client.  It's important to have an
index on it to speed up queries for the trial balance and so on.

Contributes to #1388.
  • Loading branch information
Jonathan Niles authored and jniles committed Mar 23, 2017
1 parent 6fe1d39 commit 5e6e349
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/models/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ CREATE TABLE `general_ledger` (
KEY `cc_id` (`cc_id`),
KEY `pc_id` (`pc_id`),
INDEX `trans_date` (`trans_date`),
INDEX `trans_id` (`trans_id`),
INDEX `record_uuid` (`record_uuid`),
INDEX `reference_uuid` (`record_uuid`),
INDEX `entity_uuid` (`entity_uuid`),
Expand Down Expand Up @@ -1304,6 +1305,7 @@ CREATE TABLE `posting_journal` (
KEY `cc_id` (`cc_id`),
KEY `pc_id` (`pc_id`),
INDEX `trans_date` (`trans_date`),
INDEX `trans_id` (`trans_id`),
INDEX `record_uuid` (`record_uuid`),
INDEX `reference_uuid` (`record_uuid`),
INDEX `entity_uuid` (`entity_uuid`),
Expand Down

0 comments on commit 5e6e349

Please sign in to comment.