Re: [GENERAL] Index on System Table

2012-03-22 Thread Tom Lane
=?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= writes: > 2012/3/21 Tom Lane >> BTW, I experimented with that a little bit and found that the relmapper >> is not really the stumbling block, at least not after applying this >> one-line patch: >> http://git.postgresql.org/gitweb/?p=postgresql.git;a=com

Re: [GENERAL] Index on System Table

2012-03-22 Thread Fabrízio de Royes Mello
2012/3/21 Tom Lane > > BTW, I experimented with that a little bit and found that the relmapper > is not really the stumbling block, at least not after applying this > one-line patch: > > http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=f70f095c9096d5e2689e8d79172b37b57a84e51b > >

Re: [GENERAL] Index on System Table

2012-03-21 Thread Cody Cutrer
That's awesome, thanks! Yeah, I doubt I'll do that to our production database, but maybe I'll try it on a copy sometime down the line. Adjusting the cost for pg_table_is_visible is working well enough so far. Cody Cutrer On Wed, Mar 21, 2012 at 12:17 PM, Tom Lane wrote: > Cody Cutrer writes: >>

Re: [GENERAL] Index on System Table

2012-03-21 Thread Tom Lane
Cody Cutrer writes: > On Tue, Mar 20, 2012 at 6:06 PM, Tom Lane wrote: >> There's not really support for adding indexes to system catalogs >> on-the-fly. I think it would work (barring concurrency issues) >> for most catalogs, but pg_class has special limitations due to >> the "relmapping" infra

Re: [GENERAL] Index on System Table

2012-03-21 Thread Cody Cutrer
Thanks for the tips. I spent some more time investigating. It's definitely pg_table_is_visible that's causing the problem. A \dt .* is fairly fast (like you said, it doesn't apply pg_table_is_visible at all). I tried adjusting the query in several ways. Adding either nspname=ANY(current_schema

Re: [GENERAL] Index on System Table

2012-03-20 Thread Tom Lane
Cody Cutrer writes: > I've got a SaaS situation where I'm using 1000+ schemas in a single > database (each schema contains the same tables, just different data > per tenant). ... > if I add "nspname = ANY(current_schemas(true))" to the query psql is > using, and an index to pg_class on relnamespac

[GENERAL] Index on System Table

2012-03-20 Thread Cody Cutrer
I've got a SaaS situation where I'm using 1000+ schemas in a single database (each schema contains the same tables, just different data per tenant). I used schemas so that the shared app servers could share a connection to the single database for all schemas. Things are working fine. However, whe