Re: functions and plans

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Sim Zacks <sim(at)compulab(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: functions and plans
Date: 2006-05-23 15:31:11
Message-ID: 20060523153111.GE64371@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, May 23, 2006 at 04:19:56PM +0200, Sim Zacks wrote:
> I am trying to figure out some issues with my functions and I was hoping
> someone could help me.
> My understanding is that the plan is made when the function is run the
> first time. That means that running analyze on a table after a function
> is run once won't change the plan.
>
> I have a table that I populate, select and delete the data each time the
> function is run. Each time I run the function it takes longer to get the
> data. In these tests, the data is the exact same every time.
>
> I tried putting vacuum inside the function, but I got an error, cannot
> run vacuum inside of function.
>
> Any thoughts?

Best bet would probably be to turn on autovacuum. Short of that, setup a
cronjob.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2006-05-23 15:33:36 Re: password reset
Previous Message Jim C. Nasby 2006-05-23 15:26:17 Re: To recover data corrupted