Re: [PERFORM] Having MANY MANY empty columns in database

2008-03-22 Thread Craig Ringer
In a database which we are having we have nearly 100 tables, and in 75% of the tables we have 6 columns ( INT ) as standard columns. What is standard columns, if you create a table in this database you should have some default 6 columns in there they should maintain 1. who is the owner of th

Re: [PERFORM] Having MANY MANY empty columns in database

2008-03-22 Thread sathiya psql
> > OK, so your tables all have the same fields (columns), as if you used > CREATE TABLE new_table ( LIKE some_template_table ) ? It will contain some other unique columns for each table. > meaning that they contain NULL values in that field for every record? what is the value it may contain

[PERFORM] Views and functions returning sets of records

2008-03-22 Thread Giorgio Valoti
Hi all, maybe it’s a naive question but I was wondering if there is any difference, from a performance point of view, between a view and a function performing the same task, something like: CREATE VIEW foo AS …; CREATE FUNCTION getfoo(int) RETURNS SETOF foo AS $$ SELECT * FROM foo WH

Re: [PERFORM] Views and functions returning sets of records

2008-03-22 Thread Andreas Kretschmer
Giorgio Valoti <[EMAIL PROTECTED]> schrieb: > Hi all, > maybe it?s a naive question but I was wondering if there is any > difference, from a performance point of view, between a view and a > function performing the same task, something like: > > CREATE VIEW foo AS ?; > CREATE FUNCTION getfoo(

Re: [PERFORM] Views and functions returning sets of records

2008-03-22 Thread Tom Lane
Giorgio Valoti <[EMAIL PROTECTED]> writes: > maybe it’s a naive question but I was wondering if there is any > difference, from a performance point of view, between a view and a > function performing the same task, Yes. Usually the view will win. regards, tom lane --

Re: [PERFORM] Views and functions returning sets of records

2008-03-22 Thread Andreas Kretschmer
Tom Lane <[EMAIL PROTECTED]> schrieb: > Giorgio Valoti <[EMAIL PROTECTED]> writes: > > maybe it’s a naive question but I was wondering if there is any > > difference, from a performance point of view, between a view and a > > function performing the same task, > > Yes. Usually the view will