Re: [PERFORM] Useless sort by

2010-09-22 Thread Robert Haas
On Wed, Sep 22, 2010 at 11:05 PM, wrote: > Spoken like a dyed in the wool COBOL coder.  The RM has no need for order; > it's set based.  I've dabbled in PG for some time, and my sense is > increasingly that PG developers are truly code oriented, not database (set) > oriented. I'm struggling t

Re: [PERFORM] Useless sort by

2010-09-22 Thread Scott Marlowe
On Wed, Sep 22, 2010 at 10:01 PM, Greg Smith wrote: > gnuo...@rcn.com wrote: >> >> Spoken like a dyed in the wool COBOL coder.  The RM has no need for order; >> it's set based.  I've dabbled in PG for some time, and my sense is >> increasingly that PG developers are truly code oriented, not databa

Re: [PERFORM] Useless sort by

2010-09-22 Thread Greg Smith
gnuo...@rcn.com wrote: Spoken like a dyed in the wool COBOL coder. The RM has no need for order; it's set based. I've dabbled in PG for some time, and my sense is increasingly that PG developers are truly code oriented, not database (set) oriented. I can't tell if you meant for this to be

Re: [PERFORM] Useless sort by

2010-09-22 Thread gnuoytr
Original message >Date: Wed, 22 Sep 2010 20:54:22 -0400 >From: pgsql-performance-ow...@postgresql.org (on behalf of Robert Haas >) >Subject: Re: [PERFORM] Useless sort by >To: Gaetano Mendola >Cc: Tom Lane ,pgsql-performance@postgresql.org > >On Mon, Sep 13, 2010 at 1:09 PM, Gaetano

Re: [PERFORM] Useless sort by

2010-09-22 Thread Robert Haas
On Mon, Sep 13, 2010 at 1:09 PM, Gaetano Mendola wrote: > I see your point, but some functions like:  unique, count are not affected > by the order of values fed, and I don't think either that unique has to > give out the unique values in the same fed order. Gee, I'd sure expect it to. -- Rober

Re: [PERFORM] Using Between

2010-09-22 Thread Ozer, Pam
Thank you. I will take a look at those suggestions. -Original Message- From: Robert Haas [mailto:robertmh...@gmail.com] Sent: Wednesday, September 22, 2010 9:27 AM To: Ozer, Pam Cc: Craig James; pgsql-performance@postgresql.org Subject: Re: [PERFORM] Using Between On Wed, Sep 22, 2010 a

Re: [PERFORM] Using Between

2010-09-22 Thread Robert Haas
On Wed, Sep 22, 2010 at 11:18 AM, Ozer, Pam wrote: > The question is how can we make it faster. If there's just one region ID for any given postal code, you might try adding a column to vehicleused and storing the postal codes there. You could possibly populate that column using a trigger; probab

Re: [PERFORM] Using Between

2010-09-22 Thread Ozer, Pam
The question is how can we make it faster. -Original Message- From: Robert Haas [mailto:robertmh...@gmail.com] Sent: Wednesday, September 22, 2010 3:52 AM To: Ozer, Pam Cc: Craig James; pgsql-performance@postgresql.org Subject: Re: [PERFORM] Using Between On Tue, Sep 21, 2010 at 4:04 P

Re: [PERFORM] Query much faster with enable_seqscan=0

2010-09-22 Thread Ogden
On Sep 21, 2010, at 2:34 PM, Ogden wrote: > > On Sep 21, 2010, at 2:16 PM, Greg Smith wrote: > >> Joshua D. Drake wrote: >>> PostgreSQL's defaults are based on extremely small and some would say >>> (non production) size databases. As a matter of course I always >>> recommend bringing seq_page_

Re: [PERFORM] Using Between

2010-09-22 Thread Robert Haas
On Tue, Sep 21, 2010 at 4:04 PM, Ozer, Pam wrote: > There are 850,000 records in vehicleused.  And the database is too big to be > kept in memory. Ah. So in other words, you are retrieving about half the rows in that table. For those kinds of queries, using the index tends to actually be slowe