Re: [PERFORM] query using incorrect index

2012-08-03 Thread Russell Keane
sell Keane; pgsql-performance@postgresql.org Subject: Re: [PERFORM] query using incorrect index Russell Keane wrote: > "log_min_duration_statement";"1ms" > "shared_buffers";"32MB" > "work_mem";"1MB" Those are pretty low values

Re: [PERFORM] query using incorrect index

2012-08-03 Thread Kevin Grittner
Russell Keane wrote: > "log_min_duration_statement";"1ms" > "shared_buffers";"32MB" > "work_mem";"1MB" Those are pretty low values even for a 4GB machine. I suggest the following changes and additions, based on the fact that you seem to have the active portion of the database fully cached.

Re: [PERFORM] query using incorrect index

2012-08-03 Thread Russell Keane
er: (messageq_table.incoming AND (NOT messageq_table.inactive) AND (aud_status_to_flag(messageq_table.aud_status) = 1))" "Buffers: shared read=3" "-> Bitmap Index Scan on messageq4 (cost=0.00..174.08 rows=4920 width=0) (actual time=0.037..0.037 rows=0 loops=1)&

Re: [PERFORM] query using incorrect index

2012-08-03 Thread Russell Keane
unsure that the first query is really relevant, it was simply there to justify the messageq1 index. Thanks, From: Robert Klemme [mailto:shortcut...@googlemail.com] Sent: 03 August 2012 10:18 To: Russell Keane; pgsql-performance Subject: Re: [PERFORM] query using incorrect index On Thu, Aug 2,

Re: [PERFORM] query using incorrect index

2012-08-03 Thread Robert Klemme
On Thu, Aug 2, 2012 at 4:54 PM, Russell Keane wrote: > ** ** > > Using PG 9.0 and given 2 queries (messageq_current is a view on the > messageq_table): > > ** ** > > select entity_id from messageq_current > > where entity_id = 123456; > > ** ** > > select entity_id from messageq_curre

Re: [PERFORM] query using incorrect index

2012-08-02 Thread Kevin Grittner
Russell Keane wrote: > Clearly the statistics are off somehow but I really don't know > where to start. > > Any help you can give me would be very much appreciated. It would help to know your more about your hardware and PostgreSQL configuration. The latter can probably best be communicated

[PERFORM] query using incorrect index

2012-08-02 Thread Russell Keane
Using PG 9.0 and given 2 queries (messageq_current is a view on the messageq_table): select entity_id from messageq_current where entity_id = 123456; select entity_id from messageq_current where incoming = true and inactive = false and staff_ty = 2 and staff_id = 2 order by entity_id desc limit