Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dcache-bulk: split arguments out into a separate table
Motivation: The `bulk_request` table stores the request arguments as a text string. Originally, these arguments were conceived of as globally applicable to the entire request, but with the advent of the `TAPE STAGE` json schema, they had to be adapated to accomodate arguments mapped on a per-target basis. This means that the text field for a single request could be quite sizeable if the number of targets is large. That situation has a two drawbacks. The first is that normal listing of requests is slowed down as the request table grows. The second is that inspection via the (postgres) interpreter is difficult in that lots of whitespace is dumped to stdout for each request with a large text field. One remedy for this might be to normalize `arguments` into a table `(rid, tid, name, value)` with each argument for the target being mapped to its numerical id via a join using the given path string as identifier. I have tested this and it works, but severely handicaps initial throughput because of the processing of the request on insert. A compromise which offers improvement over the current situation is simply to break out the argument text into a separate table (rid, arguments) with no further pre-processing. While this is not Third Normal Form, it does allow for the bulk_request table to remain more stable in size. The arguments are only necessary for internal processing and are never relevant for external querying (for lists, request info, etc.), so the two situations can be separated for efficiency. Modfication: Add the `request_arguments (rid, arguments)` table; insert the text string there instead of into `bulk_request`, and drop its arguments column. For queries originating from the outside (REST or admin), don't join on the arguments; for loading/caching and finding queued requests, we use a LEFT OUTER JOIN so that a `null` value for the arguments (should there be none) can be returned. The liquibase changeset takes the legacy text and merely moves it over to the new table before dropping the original column. Result: Improved query performance; the RDBMS (postgres) interpreter inspection of the `bulk_request` table is also friendlier. Target: master Requires-notes: no (unreleased) Patch: https://rb.dcache.org/r/13889/ Acked-by: Tigran
- Loading branch information
Showing
5 changed files
with
130 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters