Skip site navigation (1) Skip section navigation (2)

is_view seems unnecessarily slow

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: is_view seems unnecessarily slow
Date: 2001-01-06 20:24:51
Message-ID: 18276.978812691@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
backend/commands/command.c has a routine is_view() that tests for
view-ness by scanning pg_rewrite (all of it) to see if the given
relation has any ON SELECT rules.

This is only used to disallow AlterTableAddConstraint and
LockTableCommand on views.  While I don't care much about the
performance of AlterTableAddConstraint, it does bug me that this
might slow down LOCK TABLE a good deal.

Any objection to replacing this routine by a test for relkind = VIEW?

			regards, tom lane

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-01-06 20:41:59
Subject: Re: global/pg_database ?
Previous:From: Peter EisentrautDate: 2001-01-06 19:21:19
Subject: Open documentation items

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group