pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: admin <admin@wtbwts.com>
To: pgsql-sql@postgresql.org
Subject: stats on select
Date: Wed, 12 Jan 2000 12:12:07 +0000 (GMT)
Message-ID: <Pine.BSF.4.10.10001121207390.68073-100000@server.b0x.com> (raw)

I would like to keep statistics for records which are being selected from
my product table. If my table looks something like:
CREATE TABLE product ( name varchar(32), stats int2 );

... I would like to be able to increase product.stats when executing a
query which could look something like:
SELECT * FROM product WHERE name='3com' LIMIT 100,0;

Considering there is a LIMIT, I can't simply use UPDATE. Perhaps I should
be using rules or triggers, but I am not familiar with either. I have been
reading the Programmer's Guide and I am still having a hard time figuring
out the proper solution.

Suggestions would be very appreciated,
Marc




Message-ID: <Pine.BSF.4.10.10001121207390.68073-100000@server.b0x.com>
Permalink:  ../Pine.BSF.4.10.10001121207390.68073-100000@server.b0x.com/
Also on:    postgresql.org/message-id/Pine.BSF.4.10.10001121207390.68073-100000@server.b0x.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: admin@wtbwts.com
  Subject: Re: stats on select
  In-Reply-To: <Pine.BSF.4.10.10001121207390.68073-100000@server.b0x.com>
  References: <Pine.BSF.4.10.10001121207390.68073-100000@server.b0x.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox