Work table

From: Robert James <srobertjames(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Work table
Date: 2013-10-27 19:47:16
Message-ID: CAGYyBghBHEQKONBHfk27Jsp9dmuCoFnr+zk0Qm6HY0eMQsqyaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm using Postgres for data analysis (interactive and batch). I need
to focus the analysis on a subset of one table, and, for both
performance and simplicity, have a function which loads that subset
into another table (DELETE FROM another_table; INSERT INTO
another_table SELECT ...).

Oddly enough, although the SELECT itself is very quick (< 1 s), the
DELETE and INSERT can take over a minute! I can't figure out why.
another_table is simple: it has only 7 fields. Two of those fields
are indexed, using a simple one field standard index. There are no
triggers on it.

What is the cause of this behavior? What should I do to make this
faster? Is there a recommended work around?

(I'm hesitant to drop another_table and recreate it each time, since
many views depend on it.)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2013-10-27 20:34:04 Re: Work table
Previous Message Tom Lane 2013-10-27 16:25:06 Re: search_path and current_schema