pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to bulk load a schema using JDBC multiple times?
6+ messages / 3 participants
[nested] [flat]

* How to bulk load a schema using JDBC multiple times?
@ 2005-10-15 23:08  Andres Olarte <olarte.andres@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Andres Olarte @ 2005-10-15 23:08 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

I need to load and drop my schema multiple times during my unit tests.
This happens several thousand times per run of my test suite.  I'm
loading the schema from the file that's generated by pg_dump, and it
works, but it's SLOW. My tests are taking more than 10 minutes now,
and most of the time is spent loading the schema.  If there away to do
this faster? May be using a store procedure with the whole schema?
I've tried making such a procedure, but it doesn't work do to quoting
problems. Anybody have any ideas? Thanks

Andres



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How to bulk load a schema using JDBC multiple times?
@ 2005-10-16 03:40  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andres Olarte <olarte.andres@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2005-10-16 03:40 UTC (permalink / raw)
  To: Andres Olarte <olarte.andres@gmail.com>; +Cc: pgsql-jdbc

Andres Olarte <olarte.andres@gmail.com> writes:
> I need to load and drop my schema multiple times during my unit tests.
> This happens several thousand times per run of my test suite.  I'm
> loading the schema from the file that's generated by pg_dump, and it
> works, but it's SLOW.

Sounds to me like you've been neglecting to vacuum the system catalogs.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How to bulk load a schema using JDBC multiple
@ 2005-10-18 22:12  Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 1 reply; 6+ messages in thread

From: Kevin Grittner @ 2005-10-18 22:12 UTC (permalink / raw)
  To: olarte.andres@gmail.com; pgsql-jdbc

Have you considered having your test suite create a template
database, and using it to drop and create the test database?

>>> Andres Olarte <olarte.andres@gmail.com>  >>>
Hi,

I need to load and drop my schema multiple times during my unit tests.
This happens several thousand times per run of my test suite.  I'm
loading the schema from the file that's generated by pg_dump, and it
works, but it's SLOW. My tests are taking more than 10 minutes now,
and most of the time is spent loading the schema.  If there away to do
this faster? May be using a store procedure with the whole schema?
I've tried making such a procedure, but it doesn't work do to quoting
problems. Anybody have any ideas? Thanks

Andres




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How to bulk load a schema using JDBC multiple times?
@ 2005-10-18 23:33  Andres Olarte <olarte.andres@gmail.com>
  parent: Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 0 replies; 6+ messages in thread

From: Andres Olarte @ 2005-10-18 23:33 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; pgsql-jdbc

Hi,

Yes, but how? I tried to create a stored procedure with all of the
commands.  I tried creating a table in a special schema, storing the
schema in that table, and executing commands off that table.  They
have all failed due to quote problems.  Any other ideas?

On 10/18/05, Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:
> Have you considered having your test suite create a template
> database, and using it to drop and create the test database?
>
> >>> Andres Olarte <olarte.andres@gmail.com>  >>>
> Hi,
>
> I need to load and drop my schema multiple times during my unit tests.
> This happens several thousand times per run of my test suite.  I'm
> loading the schema from the file that's generated by pg_dump, and it
> works, but it's SLOW. My tests are taking more than 10 minutes now,
> and most of the time is spent loading the schema.  If there away to do
> this faster? May be using a store procedure with the whole schema?
> I've tried making such a procedure, but it doesn't work do to quoting
> problems. Anybody have any ideas? Thanks
>
> Andres
>
>



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How to bulk load a schema using JDBC multiple
@ 2005-10-19 15:42  Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 1 reply; 6+ messages in thread

From: Kevin Grittner @ 2005-10-19 15:42 UTC (permalink / raw)
  To: olarte.andres@gmail.com; pgsql-jdbc

http://www.postgresql.org/docs/8.0/interactive/manage-ag-templatedbs.html

>>> Andres Olarte <olarte.andres@gmail.com>  >>>
Hi,

Yes, but how? I tried to create a stored procedure with all of the
commands.  I tried creating a table in a special schema, storing the
schema in that table, and executing commands off that table.  They
have all failed due to quote problems.  Any other ideas?

On 10/18/05, Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:
> Have you considered having your test suite create a template
> database, and using it to drop and create the test database?
>
> >>> Andres Olarte <olarte.andres@gmail.com>  >>>
> Hi,
>
> I need to load and drop my schema multiple times during my unit tests.
> This happens several thousand times per run of my test suite.  I'm
> loading the schema from the file that's generated by pg_dump, and it
> works, but it's SLOW. My tests are taking more than 10 minutes now,
> and most of the time is spent loading the schema.  If there away to do
> this faster? May be using a store procedure with the whole schema?
> I've tried making such a procedure, but it doesn't work do to quoting
> problems. Anybody have any ideas? Thanks
>
> Andres
>
>




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: How to bulk load a schema using JDBC multiple times?
@ 2005-10-19 16:00  Andres Olarte <olarte.andres@gmail.com>
  parent: Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 0 replies; 6+ messages in thread

From: Andres Olarte @ 2005-10-19 16:00 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-jdbc

That's exactly what I need !

That's so easy I never thought it was useful for my situation, I was
looking for a complex way :(

Why do thing the easy way, if they can be done the hard way?

Thanks a lot !

On 10/19/05, Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:
> http://www.postgresql.org/docs/8.0/interactive/manage-ag-templatedbs.html
>
> >>> Andres Olarte <olarte.andres@gmail.com>  >>>
> Hi,
>
> Yes, but how? I tried to create a stored procedure with all of the
> commands.  I tried creating a table in a special schema, storing the
> schema in that table, and executing commands off that table.  They
> have all failed due to quote problems.  Any other ideas?
>
> On 10/18/05, Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:
> > Have you considered having your test suite create a template
> > database, and using it to drop and create the test database?
> >
> > >>> Andres Olarte <olarte.andres@gmail.com>  >>>
> > Hi,
> >
> > I need to load and drop my schema multiple times during my unit tests.
> > This happens several thousand times per run of my test suite.  I'm
> > loading the schema from the file that's generated by pg_dump, and it
> > works, but it's SLOW. My tests are taking more than 10 minutes now,
> > and most of the time is spent loading the schema.  If there away to do
> > this faster? May be using a store procedure with the whole schema?
> > I've tried making such a procedure, but it doesn't work do to quoting
> > problems. Anybody have any ideas? Thanks
> >
> > Andres
> >
> >
>
>



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2005-10-19 16:00 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-15 23:08 How to bulk load a schema using JDBC multiple times? Andres Olarte <olarte.andres@gmail.com>
2005-10-16 03:40 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-10-18 22:12 Re: How to bulk load a schema using JDBC multiple Kevin Grittner <Kevin.Grittner@wicourts.gov>
2005-10-18 23:33 ` Andres Olarte <olarte.andres@gmail.com>
2005-10-19 15:42 Re: How to bulk load a schema using JDBC multiple Kevin Grittner <Kevin.Grittner@wicourts.gov>
2005-10-19 16:00 ` Andres Olarte <olarte.andres@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox