Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TGrHN-0004t2-CT for pgsql-performance@postgresql.org; Wed, 26 Sep 2012 13:03:53 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TGrHL-0000v1-1q for pgsql-performance@postgresql.org; Wed, 26 Sep 2012 13:03:52 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1TGrHJ-0006uE-LZ for pgsql-performance@postgresql.org; Wed, 26 Sep 2012 06:03:49 -0700 Date: Wed, 26 Sep 2012 06:03:49 -0700 (PDT) From: FFW_Rude To: pgsql-performance@postgresql.org Message-ID: <1348664629662-5725491.post@n5.nabble.com> In-Reply-To: <1348662446741-5725486.post@n5.nabble.com> References: <1348662446741-5725486.post@n5.nabble.com> Subject: Re: Same query doing slow then quick MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.1 (/) X-Archive-Number: 201209/125 X-Sequence-Number: 47871 Here is the answer to Ray Stell who send me the wiki page of Slow Query. I hope i detailed all you wanted (i basicly pasted the page and add my answers). Full Table and Index Schema: schema tables_adresses "Tables" tables_adresses.adresses_XX (id (serial), X(Double precision),Y (Double precision)). "Indexes" adresses_XX_pkey (Primary key, btree) calcul_XX (non unique, Btree on X,Y) schema tables_gps "Tables" tables_gps.gps_XX (id (int),x_max(numeric(10,5)), y_max (numeric(10,5)),x_min(numeric(10,5)),y_min(numeric(10,5))) "Indexes" calculs_XX (non unique Btree x_min,x_max,y_min,y_max) gps_10_pkey (Primary key on id btree) Approximate rows 250000. No large objects in it (just data) No NULL receives a large number of UPDATEs or DELETEs regularly is growing daily I can't post an EXPLAIN ANALYZE because of the 6hour query time. Postgres version: 9.1 History: was this query always slow, : "YES" Hardware: Ubuntu server last version 32bits Daily VACUUM FULL ANALYZE, REINDEX TABLE on all the tables. WAL Configuration: Whats a WAL ? GUC Settings: i didn't change anything. All is standard. shared_buffers should be 10% to 25% of available RAM (it's on 24MB and can't go higher. The server has 4Gb) effective_cache_size should be 75% of available RAM => I don't now what this is. Test changing work_mem: increase it to 8MB, 32MB, 256MB, 1GB. Does it make a difference? "No" -- View this message in context: http://postgresql.1045698.n5.nabble.com/Same-query-doing-slow-then-quick-tp5725486p5725491.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com.