From: | "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com> |
---|---|
To: | Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: count(*) and bad design was: Experiences with extensibility |
Date: | 2008-01-09 18:58:29 |
Message-ID: | 20080109105829.37f2958d@commandprompt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wed, 9 Jan 2008 20:01:05 +0100
Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it> wrote:
> On Wed, 9 Jan 2008 10:30:45 -0600
> "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> wrote:
>
> > Now, everything's a tradeoff. If PostgreSQL had visibility
> > information in the indexes, it would have to lock both the table and
> > index for every write, thus slowing down all the other queries that
> > are trying to access the table. It would be a tradeoff that
> > sacrificed write speed for read speed. In a db that was used mostly
> > for writing, it would likely be a fair trade. In a db that did a
> > lot of writing, it might slow the whole thing to a crawl.
>
> OK... we are getting near to the point. I understand the trade-off
> problem in storing into indexes id the row is still there.
> Is there a way to get the count of the rows that *may be* there,
If you analyze regularly you can use pg_class. It isn't exact but is
usually close enough (especially if you are just using it for something
like pagination).
Joshua D. Drake
- --
The PostgreSQL Company: Since 1997, http://www.commandprompt.com/
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
SELECT 'Training', 'Consulting' FROM vendor WHERE name = 'CMD'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHhRlVATb/zqfZUUQRAoQmAJ4nkBHmZEsC8UusCT7+qul1Qa9/0QCeJFru
gnBj3ROCMz+vqbF/1Z78roY=
=iVOP
-----END PGP SIGNATURE-----
From | Date | Subject | |
---|---|---|---|
Next Message | Ivan Sergio Borgonovo | 2008-01-09 19:01:05 | Re: count(*) and bad design was: Experiences with extensibility |
Previous Message | leonardz | 2008-01-09 18:19:43 | Postgres and MySQL Rosetta stone?? |