Skip to content

(VDB-1050) add missing indexes#51

Merged
gslaughl merged 1 commit intostagingfrom
vdb-1050-add-missing-indexes
Dec 13, 2019
Merged

(VDB-1050) add missing indexes#51
gslaughl merged 1 commit intostagingfrom
vdb-1050-add-missing-indexes

Conversation

@gslaughl
Copy link
Copy Markdown
Contributor

@gslaughl gslaughl commented Dec 10, 2019

Add the indexes that postgraphile complains about lacking when run with the --no-ignore-indexes flag

Also I noticed that when running postgraphile with the api and maker schemas, a bunch of convenience methods being used by our trigger tables are exposed, so I went ahead and added omit tags to those. It might make more sense to exclude them a different way (maybe a different schema?), but I figured this might work as a first pass.

Copy link
Copy Markdown
Contributor

@rmulhol rmulhol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

Dig it, but might check with @elizabethengelman to verify this doesn't create unnecessary rebase frustration if it's merged before VDB-950

UNIQUE (header_id, address_id, vat)
);

CREATE INDEX flip_vat_address_id_index
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like sometimes above we're calling this same relationship an address_index - would be down to choose either that or address_id_index and use it everywhere

@@ -189,7 +203,12 @@ COMMENT ON TABLE maker.flip_kicks IS E'@name flipKicksStorage';
-- SQL in this section is executed when the migration is rolled back.
DROP INDEX maker.flip_kicks_address_id_index;
DROP INDEX maker.flip_kicks_kicks_index;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not introduced by this PR but I wonder why we need this index? I guess it's probably used in a join 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Currently it's not getting referenced by any other table, but my guess is we were using it at some point to get a created value for bids. Now we're getting created from flip_kick events instead of this storage table, so it seems safe to delete the index.

LANGUAGE sql;

COMMENT ON FUNCTION get_latest_flip_bid_guy
IS E'@omit';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Copy link
Copy Markdown
Contributor

@elizabethengelman elizabethengelman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

CREATE INDEX flip_bid_bid_bid_id_index
ON maker.flip_bid_bid (bid_id);
CREATE INDEX flip_bid_bid_address_id_index
CREATE INDEX flip_bid_bid_address_index
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@gslaughl gslaughl force-pushed the vdb-1050-add-missing-indexes branch from 8b462c3 to 6b403b7 Compare December 13, 2019 15:27
Copy over migrations from vDB

Omit convenience functions from postgraphile
@gslaughl gslaughl force-pushed the vdb-1050-add-missing-indexes branch from 6b403b7 to 19ed65f Compare December 13, 2019 15:56
@gslaughl gslaughl merged commit f36aeec into staging Dec 13, 2019
@gslaughl gslaughl deleted the vdb-1050-add-missing-indexes branch December 13, 2019 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants