PostgreSQL: SELECT INTO - how to create indexes?

Not sure what performance issues do you talk about, but generally, if you're making copy of table, it's much better to create indexes after inserting data I.e. - you do: create table new_table as select * from old_table Then just create indexes One option to simplify index creation is to use pg_dump and it's -s and -t options, with some "grep": pg_dump -s -t old_table database_name | \ grep -E '^CREATE. *INDEX' | \ sed 's/old_table/new_table/g.

Not sure what performance issues do you talk about, but generally, if you're making copy of table, it's much better to create indexes after inserting data. I.e. - you do: create table new_table as select * from old_table; Then just create indexes.

One option to simplify index creation is to use pg_dump and it's -s and -t options, with some "grep": pg_dump -s -t old_table database_name | \ grep -E '^CREATE. *INDEX' | \ sed 's/old_table/new_table/g.

Since SELECT INTO NEW_TABLE FROM QUERY creates NEW_TABLE the new table will not have any indices. Is there some way to utilise SELECT INTO with an existing table where I've created the desired indices? I am aware of INSERT INTO TABLE SELECT ... but I've encountered very bad performance compared to SELECT INTO.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions