Re: unique rows

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: unique rows
Дата
Msg-id 20060927202746.GA9702@wolff.to
обсуждение исходный текст
Ответ на unique rows  (TJ O'Donnell <tjo@acm.org>)
Список pgsql-sql
On Wed, Sep 20, 2006 at 22:18:04 -0700, TJ O'Donnell <tjo@acm.org> wrote:
> I want to make a table that has unique rows - no problem.
> Create Table x (smarts Varchar Unique);
> 
> I have input data that has many duplicates and until now
> I was creating a temp table allowing duplicates, and then
> Insert into x (smarts) select distinct smarts from tmpx;
> This is now failing when I have hundreds of millions of
> rows, running out of temp space (while trying to sort to
> accomplish the distinct?)

Another option would be to do a select with a GROUP BY instead of DISTINCT.
That would allow for a hash aggregate plan (don't forget to analyse the
temp table first) which would use less memory.


В списке pgsql-sql по дате отправления:

Предыдущее
От: Markus Schaber
Дата:
Сообщение: Re: Query regarding Writing a report using the file sysstem
Следующее
От: "tomcask o_o"
Дата:
Сообщение: files or DataBase