Albe Laurenz *EXTERN* wrote > Increasing the statistics for test_result.id_recipe_version > had no effect? > >> I am going to normalize the table some more before partitioning. > > How do you think that partitioning will help? I increased the statistics in steps up to 5000 (with vacuum analyse) - Seems to be as good as it gets. http://explain.depesz.com/s/z2a The simulated data is about a months worth. Partitioning is only really expected to help on insert, but that's pretty critical for us. At the moment test_item contains way too much repeated data IMHO, and I will address that asap (is going to hurt ). I will also look into creating an aggregate table to hold the 'distinct' values. Andy. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Slow-query-where-am-I-going-wrong-tp5730015p5730140.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com. -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance