Received: from mail2.panix.com (mail2.panix.com [166.84.0.213]) by hub.org (8.9.1/8.9.1) with ESMTP id HAA20660 for ; Sat, 14 Nov 1998 07:02:58 -0500 (EST) (envelope-from tomg@admin.nrnet.org) Received: from mailhost.nrnet.org (root@mailhost.nrnet.org [166.84.192.39]) by mail2.panix.com (8.8.8/8.8.8/PanixM1.3) with ESMTP id HAA09074 for ; Sat, 14 Nov 1998 07:02:53 -0500 (EST) Received: from admin.nrnet.org (uucp@localhost) by mailhost.nrnet.org (8.8.7/8.8.4) with UUCP id HAA10121 for pgsql-sql@postgreSQL.org; Sat, 14 Nov 1998 07:00:56 -0500 Received: from localhost (tomg@localhost) by admin.nrnet.org (8.8.7/8.8.7) with SMTP id HAA06777 for ; Sat, 14 Nov 1998 07:00:42 -0500 Date: Sat, 14 Nov 1998 07:00:42 -0500 (EST) From: Thomas Good To: pgsql-sql@postgreSQL.org Subject: abusing an aggregate funct In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi all... I ported a foxpro db to postgres - the foxpro strategy (if this is not a non-sequitor) was to put everything in one big table... with no unique constraints on any attr/no p_key. I had perl iterate thru the dump file prepending an int value to each tuple - which is now my p_key. Works fine. Due to the sheer girth of the table the following query, called from a data entry script, takes a bit of time to finish: SELECT max(rec_num) FROM crtrd1; I use this to setup `rec_num + 1' for my query number (p_key)...any way I can speed this up a bit? I've run vacuum analyze but the table size is doing me in... Stuck_In_Staten_Island, Tom (thanks ;-) ---------- Sisters of Charity Medical Center ---------- Department of Psychiatry ---- Thomas Good Coordinator, North Richmond C.M.H.C. Information Systems 75 Vanderbilt Ave, Quarters 8 Phone: 718-354-5528 Staten Island, NY 10304 Fax: 718-354-5056