Re: creating a subset DB efficiently ?

2024-03-09 Thread Peter J. Holzer
On 2024-03-08 11:22:17 -0500, David Gauthier wrote: > Related question... > The "delete from par_tbl_a where project <> 'a' " is taking forever. Have you checked whether all the FK columns have an index? Otherwise checking for references means a full table scan which may take a long time.

Re: creating a subset DB efficiently ?

2024-03-09 Thread Shaheed Haque
I go more or less the other way. I have a script which follows the child...parent...grandparent...etc foreign keys in the source database and dumps only the records belonging to the selected "project" (your terminology, in my case it is "client"). I save the dumped data to an archive file. The

Re: creating a subset DB efficiently ?

2024-03-09 Thread Adrian Klaver
On 3/8/24 08:22, David Gauthier wrote: Here's the situation - The DB contains data for several projects. - The tables of the DB contain data for all projects (data is not partitioned on project name or anything like that) - The "project" identifier (table column) exists in a few "parent"

Re: creating a subset DB efficiently ?

2024-03-09 Thread hector vass
On Fri, Mar 8, 2024 at 4:22 PM David Gauthier wrote: > Here's the situation > > - The DB contains data for several projects. > - The tables of the DB contain data for all projects (data is not > partitioned on project name or anything like that) > - The "project" identifier (table column)

Re: creating a subset DB efficiently ?

2024-03-08 Thread Ron Johnson
On Fri, Mar 8, 2024 at 11:22 AM David Gauthier wrote: > Here's the situation > > - The DB contains data for several projects. > - The tables of the DB contain data for all projects (data is not > partitioned on project name or anything like that) > - The "project" identifier (table column)

creating a subset DB efficiently ?

2024-03-08 Thread David Gauthier
Here's the situation - The DB contains data for several projects. - The tables of the DB contain data for all projects (data is not partitioned on project name or anything like that) - The "project" identifier (table column) exists in a few "parent" tables with many child... grandchild,...