Re: [SQL] Yet Another (Simple) Case of Index not used

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Kevin Brown <kevin(at)sysexperts(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: [SQL] Yet Another (Simple) Case of Index not used
Date: 2003-04-19 20:26:49
Message-ID: 23265.1050784009@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance pgsql-sql

Josh Berkus <josh(at)agliodbs(dot)com> writes:
> In PostgreSQL:
> a) Put table_count_A on superfast media like a RAM card so that random seeks
> after 10,000 updates do not become a significant delay;

As long as we're talking ugly, here ;-)

You could use a sequence to hold the aggregate counter. A sequence
isn't transactional and so does not accumulate dead tuples. "setval()"
and "select last_value" should have constant-time performance.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-04-19 20:33:26 Re: stddev returns 0 when there is one row
Previous Message elein 2003-04-19 20:26:34 Re: Please some help on a join question with sum aggregate

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-04-19 20:58:02 Re: [PERFORM] Foreign key performance
Previous Message Josh Berkus 2003-04-19 19:03:18 Re: [SQL] Yet Another (Simple) Case of Index not used

Browse pgsql-sql by date

  From Date Subject
Next Message Kevin Brown 2003-04-20 01:13:37 Re: [SQL] Yet Another (Simple) Case of Index not used
Previous Message Josh Berkus 2003-04-19 19:03:18 Re: [SQL] Yet Another (Simple) Case of Index not used