Re: retriving views name

From: Emmanuel SARACCO <esaracco(at)noos(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: retriving views name
Date: 2001-10-14 09:31:11
Message-ID: 3BC95B5F.5060006@noos.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi tom,

thanks for your answer; it is much more efficient your way.
I have two levels of views:

1/ generated on the fly and persistants
2/ generated on the fly just for a user session (I need to destroy these
views, but not the others).

do you know a way to access the creation time of a postgresql object?

bye

Tom Lane wrote:

> Emmanuel SARACCO <esaracco(at)noos(dot)fr> writes:
>
>>I must retrieve views names in a very short time. what can I use.
>>for the moment, I use:
>>
>
>>SELECT c.relname FROM pg_class c, pg_rewrite r WHERE (((c.relname !~
>>'^pg_'::text) AND (r.ev_class = c.oid)) AND (r.ev_type = '1'::"char"));
>>
>
> If you're using a reasonably recent PG release, there's no need to join
> against pg_rewrite. Just look for pg_class entries with relkind = 'v'.
>
>
>>is there a more performant way to do this? (I have more than 50.000
>>views in my database (those views are generated on the fly to optimize a
>>search engine and keep results in memory)). I am running a sort of
>>"garbage collector" via cron/psql -c every minutes to destroy views
>>older than 10 minutes and I must do this very rapidly!
>>
>
> One must wonder why you create views at all, if you don't intend them
> to stick around for long. Why not just write out the SELECTs in full?
> (If you think there's some performance benefit to using a view, you are
> quite mistaken.)
>
> regards, tom lane
>
>
>

--
Emmanuel SARACCO
Email: esaracco(at)noos(dot)fr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2001-10-14 14:10:39 Re: [Off-topic, Meta-question] Problems with psql-general list
Previous Message Hans-Juergen Schoenig 2001-10-13 20:54:55 PostgreSQL and OpenOffice