Re: count(*) performance improvement ideas

From: "Stephen Denne" <Stephen(dot)Denne(at)datamail(dot)co(dot)nz>
To: "PFC" <lists(at)peufeu(dot)com>
Cc: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>, "Mark Mielke" <mark(at)mark(dot)mielke(dot)cc>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: count(*) performance improvement ideas
Date: 2008-04-17 20:32:01
Message-ID: F0238EBA67824444BC1CB4700960CB48051D6243@dmpeints002.isotach.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

PFC wrote
> <Stephen(dot)Denne(at)datamail(dot)co(dot)nz> wrote:
> > I don't know plpythonu (nor python), just read a few docs now:
>
> Learn Python, it is a really useful language ;)

My wife has a snake phobia, besides, I've just started learning Scala.

> There is no sharing between processes, so
> - both SD and GD are limited to the current session
> (connection, postgres
> process), no shared memory is involved
> - GD is global between all python functions (global)
> - SD is specific to each python function (static)

Thanks.

> The big gotcha is that these are all non-transactional
> : if you rollback,
> GD and SD stay the same, and when you issue a query, you can
> assume the
> state of SD and GD is random (due to previous queries) unless you
> initialize them to a known value.

Using txid_current() as a key should alleviate that.

Regards,
Stephen Denne.

Disclaimer:
At the Datamail Group we value team commitment, respect, achievement, customer focus, and courage. This email with any attachments is confidential and may be subject to legal privilege. If it is not intended for you please advise by reply immediately, destroy it and do not copy, disclose or use it in any way.
__________________________________________________________________
This email has been scanned by the DMZGlobal Business Quality
Electronic Messaging Suite.
Please see http://www.dmzglobal.com/dmzmessaging.htm for details.
__________________________________________________________________

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Browne 2008-04-17 20:33:19 Re: get rid of psql welcome message
Previous Message Heikki Linnakangas 2008-04-17 19:48:27 Re: Patch for Prevent pg_dump/pg_restore from being affected by statement_timeout