inheritance performance
От | ken |
---|---|
Тема | inheritance performance |
Дата | |
Msg-id | 1106295545.6622.266.camel@pesky.s6portland обсуждение исходный текст |
Ответы |
Re: inheritance performance
|
Список | pgsql-performance |
Wondering ... From a performance standpoint, is it a bad idea to use inheritance simply as a tool for easy database building. That is for creating tables that share the same columns but otherwise are unrelated. For example, let's say I have the following set of columns that are common to many of my tables. objectid int, createdby varchar(32), createddate timestamp ... and let's say I create a table with these columns just so that I can then create other tables that inherit this table so that I have these columns in it without having to respecify them over and over again separately for each table that contains them. From my understanding, all the data for these columns in all the child tables will be stored in this one parent table and that, furthermore, there is a "hidden" column in the parent table called tableoid that allows postgres to determine which row is stored in which child table. Given that, is there a performance hit for queries on the child tables because postgres has to effectively put a condition on every query based on the tableoid of the given child table? In other words, if say child table A has 10 million rows in it and child B has 2 rows in it. Will a query on child table B be slowed down by the fact that it inherits from the same table as A. I'm sure the answer is absolutely yes, and so I guess I'm just looking for corroboration. Maybe I'll be surprised! Thanks a bunch, Ken
В списке pgsql-performance по дате отправления: