Re: Load a csv or a avro?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: sud <suds1434(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Load a csv or a avro?
Date: 2024-07-07 15:14:50
Message-ID: 5937dba2-8ac5-4c88-a419-7bd4f428e9bf@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/6/24 13:09, sud wrote:
> On Fri, Jul 5, 2024 at 8:24 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com
> <mailto:adrian(dot)klaver(at)aklaver(dot)com>> wrote:
>
> On 7/5/24 02:08, sud wrote:
> > Hello all,
> >
> > Its postgres database. We have option of getting files in csv
> and/or in
> > avro format messages from another system to load it into our
> postgres
> > database. The volume will be 300million messages per day across many
> > files in batches.
>
> Are dumping the entire contents of each file or are you pulling a
> portion of the data out?
>
>
>
> Yes, all the fields in the file have to be loaded to the columns in the
> tables in postgres. But how will that matter here for deciding if we
> should ask the data in .csv or .avro format from the outside system to
> load into the postgres database in row and column format? Again my
> understanding was that irrespective of anything , the .csv file load
> will always faster as because the data is already stored in row and
> column format as compared to the .avro file in which the parser has to
> perform additional job to make it row and column format or map it to the
> columns of the database table. Is my understanding correct here?

If you are going to use complete rows and all rows then COPY of CSV in
Postgres would be your best choice.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Valeria Kaplan 2024-07-08 15:41:47 New Meet-up in the Stuttgart / Tübingen
Previous Message Pavel Stehule 2024-07-07 15:02:37 Re: Declaring a field that is also an out parameter in a function