Re: break table into portions for writing to separate files

From: Szymon Guz <mabewlun(at)gmail(dot)com>
To: Seb <spluque(at)gmail(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: break table into portions for writing to separate files
Date: 2014-05-01 20:31:46
Message-ID: CAFjNrYs=uFC73uXymR_M8DVmDVVWZW_wJ34Za629qJNO_pga1g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1 May 2014 22:24, Seb <spluque(at)gmail(dot)com> wrote:

> On Thu, 1 May 2014 22:17:24 +0200,
> Szymon Guz <mabewlun(at)gmail(dot)com> wrote:
>
> > On 1 May 2014 21:01, Seb <spluque(at)gmail(dot)com> wrote:
> > On Thu, 1 May 2014 20:22:26 +0200,
> > Szymon Guz <mabewlun(at)gmail(dot)com> wrote:
>
> >> Hi, several Gb is about 1GB, that's not too much. In case you meant
> >> 'several GB', that shouldn't be a problem as well.
>
> > Sorry, I meant several GB. Although that may not be a problem for
> > PostgreSQL, it is for post-processing the output file with other
> > tools.
>
> >> The first thing I'd do would be creating an index on the column used
> >> for dividing the data. Then I'd just use the command COPY with a
> >> proper select to save the data to a file.
>
> > I should have mentioned that this is quite a complex view (not a
> > table), which joins several other views of similar complexity. I'm
> > not sure whether indexes are useful/feasible in this case. I'll
> > investigate.
>
> > Yes, indexes can be used to speed up the view as well. Such a view is
> > nothing more than just a query.
>
> Help for CREATE INDEX says that its target should be a table or
> materialized view, so I'm guessing you mean indexes on the relevant
> fields of the underlying tables. In that case, I already have indexes
> on those, especially the timestamp fields which are the ones that are
> used for the heavy query work.
>
>

Can you show us the query plan for the queries you are using, the view
definition, and how you query that view?

Szymon

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Seb 2014-05-01 20:50:00 Re: break table into portions for writing to separate files
Previous Message Seb 2014-05-01 20:24:43 Re: break table into portions for writing to separate files