If you are comfortable doing direct database interactions, you probably want to try the Isotammi add-on: SuperTool.
An introductory task using SuperTool can be found in the “Tree vivisection experiments with the Isotammi SuperTool” thread.
(The most straighforward Installation requires briefly redirecting the Third party addons management in Preferences to look at the Isotammi Project’s addon server. In Gramps 5.2 and newer, the Addon Manager allows checking multiple collections of addons.)