"Christian Hofmann" <christian(dot)hofmann(at)gmx(dot)de> writes:
> INSERT INTO table2 (my_col) SELECT DISTINCT my_col from table1
> But this query was so slow that I stopped it. I let it run for five days!
What PG version is this, and what do you have sort_mem set to?
Increasing sort_mem to a few hundred meg should help, assuming the
server can spare that much RAM.
> In the Server there is only 1 GB RAM. My_col is using a bitmap index.
There are no bitmap indexes in Postgres...
regards, tom lane