abusing an aggregate funct - Mailing list pgsql-sql

From Thomas Good
Subject abusing an aggregate funct
Date
Msg-id Pine.LNX.3.96.981114065037.6759A-100000@admin.nrnet.org
Whole thread Raw
In response to Some questions  (Vladimir Litovka <pgsqll@barnet.kharkov.ua>)
Responses Re: [SQL] abusing an aggregate funct  (Marc Howard Zuckman <marc@fallon.classyad.com>)
List pgsql-sql
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                          <tomg@q8.nrnet.org>
    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


pgsql-sql by date:

Previous
From: "Jiang Feng"
Date:
Subject: unsubscribe
Next
From: Marc Howard Zuckman
Date:
Subject: Re: [SQL] abusing an aggregate funct