Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA00831; Wed, 9 Jun 93 14:25:54 -0700
Date: Wed, 9 Jun 93 14:25:54 -0700
Message-Id: <9306092125.AA00831@postgres.Berkeley.EDU>
From: ruby!imram@colossus.apple.com (Steve Davidson)
Subject: Profiling database
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu

Dear Postgressors,

1) How can I tell which indexes are used by a particular query?
   Is there any way to see the optimizations that a retrieve invokes?

2) Is there any code or instructions describing how to profile
   Postgres retrieve operations?

   I'm using PGPERL to do some simple profiling of Postgres on my 
   computer.  The steps are simple:

   a) Make a large data base with some unique value in each record.

   b) Without any indexes, 
	 measure time to access the first record;
         measure time to access last record.
         measure time to access 1000 records at random.

   c) Define an index, and repeat tests in #2

3) When using the following retrieves (assume a large number of tuples):

   retrieve portal eportal QUERY   ...and then
   fetch all in eportal

   Which operation consumes the majority of CPU cycles?
   the retrieve or the fetch?

   Any other ideas?  

   My perl code is available upon request to whoever wants it.
   Be warned its just a frame for doing some profiling.

steved@cfcl.com

