nih-cfde / cfde-deriva

Collaboration point for miscellaneous CFDE-deriva scripts
Other
2 stars 3 forks source link

Problem saving query #401

Closed jrchudy closed 1 year ago

jrchudy commented 1 year ago

Aref encountered the following issue when trying to save a query in CFDE while testing the url length limitation bug that was found (which we think is because of favorites)

400 Bad Request
The request is malformed. index row size 3000 exceeds btree version 4 maximum 2704 for index "saved_query_encoded_facets_idx"
DETAIL:  Index row references tuple (2,7) in relation "saved_query".
HINT:  Values larger than 1/3 of a buffer page cannot be indexed.
Consider a function index of an MD5 hash of the value, or use full text indexing.

This isn't an error that is thrown from ermrestJS or chaise. Hongsuda mentioned this is more likely because of the jsonb being included in the indexing for searching and in this case the "facets" column for the saved query was very very large.

karlcz commented 1 year ago

This issue was mitigated in April in the deployed system by dropping unnecessary btree indexes saved_query_facets_idx and saved_query_encoded_facets_idx which imposed a length limit on column values. Since we do not redeploy this table, this fix has been persistent.

A commit has also been pushed to cfde-deriva to record the indexing preference for these columns in the model used to deploy a new registry.