Re: export to excel format

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: John McNamara <jmcnamara(at)cpan(dot)org>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: export to excel format
Date: 2003-04-14 01:24:54
Message-ID: 20030414012454.GA19323@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Sun, Apr 13, 2003 at 20:05:28 -0500,
Bruno Wolff III <bruno(at)wolff(dot)to> wrote:
> On Fri, Apr 11, 2003 at 15:05:34 -0700,
> John McNamara <jmcnamara(at)cpan(dot)org> wrote:
> > bruno(at)wolff(dot)to (Bruno Wolff III) wrote:
> >
> > > I wrote a perl program that gets data from
> > > the database and writes excel spreadsheets. It uses Spreadsheet::WriteExcel
> > > which you can get from CPAN. It seems to be pretty slow. It takes about
> > > 3 minutes to produce a 4MB spreadsheet.
> >
> >
> > Are you sure that the delay is caused by Spreadsheet::WriteExcel. The
> > following program produces a 4MB file in 3 seconds on a P700:
>
> That runs in a couple of seconds here. There must be something else making
> it a lot slower. Splitting the sheets out with ParseExcel takes about a
> minute, so just having about four hundred worksheets may account for
> a good chunk of the time if there is substantial per sheet overhead.
> There also is a query per sheet that takes about a quarter of a second per
> sheet. This would account for about a minute and a half right there.

I double checked and the query seems to now be taking about .6 seconds
for sheets on the bigger end. That would account for virtually all of
the time.
I had problems with a similar version of this query that slowed down a
lot in 7.3.1 or 7.3.2 when an incorrect optimization bug was fixed.
Moving to 7.4 development cut the time for at least the original version
in half. Looking at the explain results makes it seem there is some
hope for improvement as the plan doesn't look like it is taking full
advantage of available indexes. But I need to look at it some more to
see why that might be.
Thanks for pointing out that WriteExcel was not really the problem. I couldn't
have done much about that, but I think I have a chance to make the query run
significantly faster.

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message jason_long 2003-04-14 03:13:16 Please give me a help.
Previous Message Min_Bee_Ng 2003-04-14 01:16:01 Problem in installing the PgAdminII in Window XP