Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZUjOY-0007gg-16 for pgsql-performance@arkaria.postgresql.org; Wed, 26 Aug 2015 22:42:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZUjOX-0003XW-FB for pgsql-performance@arkaria.postgresql.org; Wed, 26 Aug 2015 22:42:13 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZUjOW-0003XP-Ob for pgsql-performance@postgresql.org; Wed, 26 Aug 2015 22:42:12 +0000 Received: from mail-wi0-f174.google.com ([209.85.212.174]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZUjOT-0001a0-PN for pgsql-performance@postgresql.org; Wed, 26 Aug 2015 22:42:11 +0000 Received: by widdq5 with SMTP id dq5so60774079wid.1 for ; Wed, 26 Aug 2015 15:42:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=l5xwkrmxwNW5vch8b7nuePlbXJmkxrcTR0VKVTrZ7EA=; b=L7+DsApA3aqt1uFGm8emc5Qg3cWyMa/POic+pBh4CO4j3NRqAMM7ay9WhNjl8EXTW4 GNTH2znrdB+dNVDyQQXyU9qmbw8KacImnJS2ja7tulQkRiM8TgPDjgZE/lwbUPsvidhy SwM0AUicPur8QuPFmfxhGSmAtwRBqPhuptxCXfyQoSEwV/t1MLXhoe9/i7//Aleu5cvq j3vMaD8R9BES075asdsw3IYStUGxFrNbke74z+UEMjZsZmETvbPokJxhCVf1aNG4quru q00kLA6lpmReOMVNdjMeN4wC7kenFef+3NHQOahPNtSYKFM5NGdYd58W+QVSWzTrS1MV 5sBw== X-Gm-Message-State: ALoCoQlsD9Y6tU7yYOFVhebVeVJ1IIfQwO25bUdGsm8IKPExvW8pFOUPVBR4g0yGWVouaK9FjcNQGRs4yrlvjuYqiND0DMPBRiRHKa/zEeDdsNdvvFWm+ksQhIzloI05eDX9DydRB8WqaJwpW1n0KNdtdjXhHkdQb+j0wWCh9DXpdWwCpT31jG7fKxWJuMQKP9soqVeRrQyKksrR59X/n47jFR7tp6xMBg== X-Received: by 10.194.94.73 with SMTP id da9mr736483wjb.97.1440628927851; Wed, 26 Aug 2015 15:42:07 -0700 (PDT) Received: from [10.137.2.12] (ip-78-45-136-74.net.upcbroadband.cz. [78.45.136.74]) by smtp.gmail.com with ESMTPSA id uo6sm211403wjc.1.2015.08.26.15.42.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2015 15:42:06 -0700 (PDT) Message-ID: <55DE40BA.5000401@2ndquadrant.com> Date: Thu, 27 Aug 2015 00:42:02 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Index creation running now for 14 hours References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 08/26/2015 10:26 PM, Tory M Blue wrote: > > the table is 90GB without indexes, 285GB with indexes and bloat, The > row count is not actually completing.. 125Million rows over 13 months, > this table is probably close to 600million rows. You don't need to do SELECT COUNT(*) if you only need an approximate number. You can look at pg_class.reltuples: SELECT reltuples FROM pg_class WHERE relname = 'impressions'; That should be a sufficiently accurate estimate. > The above is when it had finished copying the table and started on the > index.. > > Well as I said I'm running out of storage as the index is creating some > serious data on the filesystem, I'll have to kill it, try to massage the > data a bit and increase the maintenance_work mem to use some of my 256GB > of ram to try to get through this. Right now the 100% cpu process which > is this index is only using 3.5GB and has been for the last 15 hours Please post details on the configuration (shared_buffer, work_mem, maintenance_work_mem and such). BTW while the the CREATE INDEX is reporting 3.5GB, it most likely wrote a lot of data into on-disk chunks when sorting the data. So it's actually using the memory through page cache (i.e. don't increase maintenance_work_mem too much, you don't want to force the data to disk needlessly). regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance