Re: [PERFORM] Odd behavior with indices

2016-02-26 Thread David G. Johnston
On Fri, Feb 26, 2016 at 1:38 PM, joe meiring wrote: > Here's the distribution of parameter_id's > > select count(parameter_id), parameter_id from datavalue group by parameter_id > 88169 142889171 815805 178570124257262 213947049 151225902 24091090 > 3103877

[PERFORM] Merge joins on index scans

2016-02-26 Thread James Parks
Dear psql-performance, I'm having issues with a certain query, and I was hoping you could help me out. The schema: (start with new database cluster, with either SQL_ASCII or en.us-UTF8 encoding, using the default server configuration available in the pgdg Jessie packages). CREATE TABLE a (id

Re: [PERFORM] Odd behavior with indices

2016-02-26 Thread joe meiring
Here's the distribution of parameter_id's select count(parameter_id), parameter_id from datavalue group by parameter_id 88169 142889171 815805 178570124257262 213947049 151225902 24091090 3103877 10633764 11994442 1849232 2014935 4563638 132955919 7 On Fri, Feb 26, 2016 at 2:02

Re: [PERFORM] Odd behavior with indices

2016-02-26 Thread David G. Johnston
On Fri, Feb 26, 2016 at 12:43 PM, joe meiring wrote: > Also available on S.O.: > > > http://stackoverflow.com/questions/35658238/postgres-odd-behavior-with-indices > > I've got a datavalue table with ~200M rows or so, with indices on both > site_id and parameter_id. I

[PERFORM] Odd behavior with indices

2016-02-26 Thread joe meiring
Also available on S.O.: http://stackoverflow.com/questions/35658238/postgres-odd-behavior-with-indices I've got a datavalue table with ~200M rows or so, with indices on both site_id and parameter_id. I need to execute queries like "return all sites with data" and "return all parameters with