Re: [PERFORM] NULLS LAST performance

2011-02-23 Thread Tom Lane
Merlin Moncure writes: > you can always do this: > create index performance_creation_date_desc_idx on > performance(creation_date desc nulls last); > which will index optimize your sql. Interesting that 'null last' > fools disallows index usage even when the index was created with > nullls last

Re: [PERFORM] Unused indices

2011-02-23 Thread Greg Smith
Benjamin Krajmalnik wrote: Index Scans0 Index Tuples Read 0 Index Tuples Fetched0 Index Blocks Read 834389 Index Blocks Hit247283300 Index Size 1752 kB Since there are no in

Re: [PERFORM] performance issue in the fields.

2011-02-23 Thread Merlin Moncure
On Mon, Feb 14, 2011 at 5:36 AM, Pavel Stehule wrote: > Hello > > 2011/2/14 dba : >> >> >> create table a( address1 int,address2 int,address3 int) >> create table b(address int[3]) >> >> I have created two tables. In the first table i am using many fields to >> store 3 address. >> as well as in b

Re: [PERFORM] NULLS LAST performance

2011-02-23 Thread Merlin Moncure
On Wed, Feb 23, 2011 at 1:27 PM, Mathieu De Zutter wrote: > Hi all, > Running PostgreSQL 8.4.7 (backport package from Debian Lenny). > I have some queries that are based on views, and an engine adds a few > clauses (like NULLS LAST). One of these queries has a performance problem. > The simplified

[PERFORM] NULLS LAST performance

2011-02-23 Thread Mathieu De Zutter
Hi all, Running PostgreSQL 8.4.7 (backport package from Debian Lenny). I have some queries that are based on views, and an engine adds a few clauses (like NULLS LAST). One of these queries has a performance problem. The simplified form is this: shs=# explain analyze select * from performance e

[PERFORM] Unused indices

2011-02-23 Thread Benjamin Krajmalnik
I am trying to clean up our schema by removing any indices which are not being used frequently or at all. Using pgadmin, looking at the statistics for an index, I see various pieces of information: Index Scans, Index Tuples Read, Index Tuples Fetched, Index Blocks Read, and Index Blocks Hit.

Re: [PERFORM] Exhaustive list of what takes what locks

2011-02-23 Thread Robert Haas
On Wed, Feb 23, 2011 at 12:31 PM, Tom Lane wrote: > Robert Haas writes: >> ...but that begs the question of why DROP INDEX needs an >> AccessExclusiveLock.  It probably needs such a lock *on the index* but >> I don't see why we'd need it on the table. > > Some other session might be in process of

Re: [PERFORM] Exhaustive list of what takes what locks

2011-02-23 Thread Tom Lane
Robert Haas writes: > ...but that begs the question of why DROP INDEX needs an > AccessExclusiveLock. It probably needs such a lock *on the index* but > I don't see why we'd need it on the table. Some other session might be in process of planning a query on the table. It would be sad if the inde

Re: [PERFORM] Exhaustive list of what takes what locks

2011-02-23 Thread Robert Haas
On Tue, Feb 22, 2011 at 11:21 PM, Noah Misch wrote: > On Tue, Feb 22, 2011 at 10:18:36PM -0500, Robert Haas wrote: >> On Wed, Feb 2, 2011 at 12:20 AM, Noah Misch wrote: >> >> CREATE TABLE account (account_id SERIAL PRIMARY KEY, name CHARACTER >> >> VARYING >> >> NOT NULL); >> >> CREATE TABLE foo