Re: SELECT INTO large FKyed table is slow

Поиск
Список
Период
Сортировка
От Mario Splivalo
Тема Re: SELECT INTO large FKyed table is slow
Дата
Msg-id 4CF5FF0A.9040605@megafon.hr
обсуждение исходный текст
Ответ на Re: SELECT INTO large FKyed table is slow  ("Joshua D. Drake" <jd@commandprompt.com>)
Ответы Re: SELECT INTO large FKyed table is slow  (Mladen Gogala <mladen.gogala@vmsinfo.com>)
Список pgsql-performance
On 12/01/2010 02:47 AM, Joshua D. Drake wrote:
> On Sun, 2010-11-28 at 12:46 +0100, Mario Splivalo wrote:
>> The database for monitoring certain drone statuses is quite simple:
>>
>
>> This is the slow part:
>> INSERT INTO drones_history (sample_id, drone_id, drone_log_notice,
>> drone_temperature, drone_pressure)
>> SELECT * FROM tmpUpdate;
>>
>> For 100 rows this takes around 2 seconds. For 1000 rows this takes
>> around 40 seconds. For 5000 rows this takes around 5 minutes.
>> For 50k rows this takes around 30 minutes! Now this is where I start lag
>> because I get new CSV every 10 minutes or so.
>
> Have you considered making the foreign key check deferrable?
>

Yes, as Mladen Gogala had advised. No noticable change in performance -
it's still slow :)

But, just for the sake of clarification - I tought that DEFERRABLE would
matter if I do a lot of INSERTs, inside a FOR loop or something like
that. Since I'm doing INSERT INTO ... SELECT, does it makes any difference?

    Mario

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

Предыдущее
От: Mario Splivalo
Дата:
Сообщение: Re: SELECT INTO large FKyed table is slow
Следующее
От: "Pierre C"
Дата:
Сообщение: Re: BBU Cache vs. spindles