is_view seems unnecessarily slow - Mailing list pgsql-hackers

From Tom Lane
Subject is_view seems unnecessarily slow
Date
Msg-id 18276.978812691@sss.pgh.pa.us
Whole thread Raw
Responses Re: is_view seems unnecessarily slow
List 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


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Open documentation items
Next
From: Patrick Welche
Date:
Subject: global/pg_database ?