pg.ddx.io  postgis-users@lists.osgeo.org mailing list archive (PostGIS users)  
help / color / mirror / Atom feed
From: Richard Gomes <rgomes1997@yahoo.co.uk>
Subject: [postgis-users] (no subject)
Date: Thu, 07 Apr 2011 18:17:57 +0100
Message-ID: <4D9DF1C5.6060304@yahoo.co.uk> (raw)
In-Reply-To: <DUB103-w38B4DB5D4AF648D3684579B7A40@phx.gbl>
References: <DUB103-w38B4DB5D4AF648D3684579B7A40@phx.gbl>

Hi,

I suggest you try "double precision" instead of "numeric".
 From Java perspective, "double precision" is a double whilst "numeric" 
is a BigDecimal, which consumes much more memory and network bandwidth 
than double. You could also consider "real" instead of "double 
precision", which maps to Java floats, if you don't need much accuracy.

http://www.postgresql.org/docs/8.4/static/datatype-numeric.html

I hope it helps

Cheers :)

Richard Gomes
http://www.jquantlib.org/index.php/User:RichardGomes
twitter: frgomes

JQuantLib is a library for Quantitative Finance written in Java.
http://www.jquantlib.com/
twitter: jquantlib


On 07/04/11 17:57, Paul & Caroline Lewis wrote:
> DB SIZE PROBLEM:
>    I have run the following tests on a Postgresql 9 with postgis 1.5 
> platform and am getting significant table and index size differences.
> TestSet1 is run with a file tunnel6.asc, a CSV file with the following 
> being a sample of the data:
> -6.34223029,53.39211958,132.586
> The file is 6 GB in size with 70 million rows. After running TestSet1 
> the table has the correct number of rows (70 mill), random viewing of 
> the data and it seems fine, while the table size is 16 GB and the 
> index size is 6195 MB.
>
> I now Drop Cascade the tunnel6  table for TestSet2
>
> For TestSet2 it is run on a preprocessed version of tunnel6.asc, now 
> called tunnel6_py.asc, with the following being a sample of the data:
> -6.34223029,53.39211958,132.586,SRID=4326;POINT(-6.34223029 
> 53.39211958 132.586)
> This file grows to 8 GB and still has 70 million rows but after 
> following TestSet2 steps while the table still has the correct number 
> of rows (70 mill), random viewing of the data and it still seems fine 
> but now the table size is 9.5 GB and the index size is 3363 MB.
>
> Have I done something significantly wrong in these tests?
> The TestSet2 process loads the data about 10 minutes quicker than 
> TestSet1 so I would like to use it but I don't trust it now given the 
> significant differences in table sizes.
>
> --********************************************************************/
> --TestSet1
> --********************************************************************/
> CREATE TABLE tunnel6
> (
> latitude numeric,
> longitude numeric,
> altitude numeric);
>
> COPY tunnel6 (
>    latitude,
>    longitude,
>    altitude,)
>   FROM '/media/storage/tunnel6.asc'
>   CSV
>   HEADER;
>
> SELECT AddGeometryColumn('tunnel6','wgs_geom','4326','POINT',3);
>
> UPDATE tunnel6 SET wgs_geom = ST_SETSRID(ST_MAKEPOINT(longitude, 
> latitude, altitude),4326);
>
> CREATE INDEX tunnel6_wgs_point ON tunnel6 USING gist(wgs_geom);
> --********************************************************************/
> --TestSet2 - Python PreProcessed Input File
> --********************************************************************/
> --********************************************************************/
> CREATE TABLE tunnel6
> (
> latitude numeric,
> longitude numeric,
> altitude numeric
> );
>
> SELECT AddGeometryColumn('tunnel6','wgs_geom','4326','POINT',3);
>
> COPY tunnel6(
>    latitude,
>    longitude,
>    altitude,
>    wgs_geom)
>   FROM '/media/storage/tunnel6_py.asc'
>   CSV
>   HEADER;
>
> CREATE INDEX tunnel6_wgs_point ON tunnel6 USING gist(wgs_geom);
> --********************************************************************/
>
> Any help or insights would be much appreciated.
> Thanks.
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110407/a6c9706a/attachment.html;



view thread (131+ messages)  latest in thread

Message-ID: <4D9DF1C5.6060304@yahoo.co.uk>
Permalink:  ../4D9DF1C5.6060304@yahoo.co.uk/

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: postgis-users@lists.osgeo.org
  Cc: rgomes1997@yahoo.co.uk
  Subject: Re: [postgis-users] (no subject)
  In-Reply-To: <4D9DF1C5.6060304@yahoo.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox