Skip site navigation (1) Skip section navigation (2)

taking a sparse slice of an array

From: Michael Lush <mjlush(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: taking a sparse slice of an array
Date: 2011-12-09 08:15:17
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Thank you for the useful responses to 'Big Wide Datasets'

I decided to have a go with the array option and initially it looked very

time psql test -c "SELECT sample_id, snp_data[40000] FROM gwas_test" >

returned in 5 minutes from a 100000 row table.

The trouble is that it does not scale

time psql test -c "SELECT sample_id, snp_data[40000], snp_data[50000] FROM
gwas_test" > /dev/null

takes 10 minutes :-(

Is there anyway to speed this up I can see snp_data[40000:50000] returns
values from 40 to 50 thousand,
is there any way to so something like


which would just return a 5 element array?



pgsql-novice by date

Next:From: Jean-Yves F. BarbierDate: 2011-12-09 08:33:31
Subject: Re: taking a sparse slice of an array
Previous:From: Jean-Yves F. BarbierDate: 2011-12-09 05:35:42
Subject: Re: pgAdmin3 grant wizard question

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group