Re: Query very slow when in plpgsql function

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Query very slow when in plpgsql function
Date: 2009-12-31 22:53:13
Message-ID: 488efa144a2d43fe5f2cca7f78e9d642@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

> And when I execute the function with the same parameters it takes well
> over 5 minutes to execute.
>
> It seems as though inside a function, the optimizer wants to tablescan
> my 8M row table. Is there a way that I can see the query plans that my
> functions are using?

See my blog post on this:

http://blog.endpoint.com/2008/12/why-is-my-function-slow.html

It's also in the first page of hits when you google the subject
line of this thread. :)

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 200912311751
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAks9Kz8ACgkQvJuQZxSWSsj72QCgvrcUOTF8cXyVkIZ29ky3YOmp
p+IAoOmgyTICVXBmndHADua3ypNC0ctK
=dZtE
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shu Ho 2009-12-31 23:11:12 please help
Previous Message Scott Marlowe 2009-12-31 21:22:53 Re: Migration of db