Re: [PERFORM] index usage on queries on inherited tables

2011-04-29 Thread Robert Haas
On Apr 27, 2011, at 11:11 PM, Joseph Shraibman wrote: > On 04/27/2011 04:32 PM, Robert Haas wrote: >> In the first case, PostgreSQL evidently thinks that using the indexes >> will be slower than just ignoring them. You could find out whether >> it's right by trying it with enable_seqscan=off. >

Re: [PERFORM] index usage on queries on inherited tables

2011-04-27 Thread Greg Smith
Joseph Shraibman wrote: In a 52 gig table I have a "select id from table limit 1 order by id desc" returns instantly, but as soon as you declare a child table it tries to seq scan all the tables. This is probably the limitation that's fixed in PostgreSQL 9.1 by this commit (following a few

Re: [PERFORM] index usage on queries on inherited tables

2011-04-27 Thread Samuel Gendler
On Wed, Apr 27, 2011 at 2:11 PM, Joseph Shraibman wrote: > On 04/27/2011 04:32 PM, Robert Haas wrote: > > In the first case, PostgreSQL evidently thinks that using the indexes > > will be slower than just ignoring them. You could find out whether > > it's right by trying it with enable_seqscan=of

Re: [PERFORM] index usage on queries on inherited tables

2011-04-27 Thread Joseph Shraibman
On 04/27/2011 04:32 PM, Robert Haas wrote: > In the first case, PostgreSQL evidently thinks that using the indexes > will be slower than just ignoring them. You could find out whether > it's right by trying it with enable_seqscan=off. My point is that this is just a problem with inherited tables.

Re: [PERFORM] index usage on queries on inherited tables

2011-04-27 Thread Robert Haas
On Fri, Apr 1, 2011 at 2:41 AM, Joseph Shraibman wrote: > When I do a query on a table with child tables on certain queries pg > uses indexes and on others it doesn't. Why does this happen? For example: > > > [local]:playpen=> explain analyze select * from vis where id > 10747 ; >                

[PERFORM] index usage on queries on inherited tables

2011-03-31 Thread Joseph Shraibman
When I do a query on a table with child tables on certain queries pg uses indexes and on others it doesn't. Why does this happen? For example: [local]:playpen=> explain analyze select * from vis where id > 10747 ; QUERY PLAN