Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hw6sU-00035T-7T for pgsql-general@arkaria.postgresql.org; Fri, 09 Aug 2019 15:32:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hw6sS-0003P3-3E for pgsql-general@arkaria.postgresql.org; Fri, 09 Aug 2019 15:32:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hw6sQ-0003Ow-DQ for pgsql-general@lists.postgresql.org; Fri, 09 Aug 2019 15:32:23 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hw6sJ-00073g-7r for pgsql-general@lists.postgresql.org; Fri, 09 Aug 2019 15:32:21 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0CC0B21AF1; Fri, 9 Aug 2019 11:32:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 09 Aug 2019 11:32:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=E KYSFc5wRFUpqea7B3rAu7bzltCS1LxttYHu6Vbp3pA=; b=cHulbN+msYIn5UoLo U2bYh7UuKUF/1sCpVMF4JWMA5i1RVwI3bOmDLI49FiXeKLdZz6NOVsg8OZTKixVL wMYvjaw8UAu+sMqgH6ltPNok+fcBaOJikoX5WlVGrEfb7q3EAp+uyt7T+ejFYnaW AelNxKmj79EnwyqYNicB+RHt6HDYvTiQH/2Dcv+unPjHbawPvCrvvnI+D7yF/65Q nsPXZtB87qB+gx797Eacr8r4No3v6JivTgvp7UKmXC+xPp+Qj3TOdqeE4t/JVVQ8 nmBEOB5qFKANbpRl3VhTseMlhU5IuuOztBQqu0vJhmI4f0BPbKIPa1z1K8ny95WH lQQlQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=EKYSFc5wRFUpqea7B3rAu7bzltCS1LxttYHu6Vbp3 pA=; b=eoRafPpdlVzx8m6Oxuy7lOp4N+1VV0KgUI54TuVT56wcY0gfwYhk3S5GC QLewN9gr2OzCdnlo05Afmb8T3cbg0zQITuOiMxP4ezgjt1+V620gd0jyYyqfQ2dz 5/dzyAtmZkxnqLpYV0MhfD7XuTboFt0szBzwSr/+/6rxXESbAFWFPG+h33MtXj1/ aEAZ18zXUdyPACK5SHs/JG9G0eR66C8r0nONKN/8aKSdm3pmnJlHLo+Ejd+4hFoe 5fSFiivRpFnOSlDgbNccofrKFuURu5jpQX/fxy795i8JeCRjnoQYwPEm79olvqTz JZxjWRVApwZGZer3VxhP0qBmGBbcw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddruddujedgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgpdhgihhthhhusgdrihho necukfhppeejuddrvdduvddrudehtddrvddtvdenucfrrghrrghmpehmrghilhhfrhhomh eprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghr ufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id DFEC5380079; Fri, 9 Aug 2019 11:32:12 -0400 (EDT) Subject: Re: Generate test data inserts - 1GB To: Shital A Cc: pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Fri, 9 Aug 2019 08:32:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 8/9/19 8:14 AM, Shital A wrote: > > > On Fri, 9 Aug 2019, 20:08 Adrian Klaver, > wrote: > > On 8/9/19 4:12 AM, Shital A wrote: > > Hello > > > > Postgresql 9.6 > > > > Need to generate 1GB test data in very less time. I got some > techniques > > online but they take around 40mins for 400GB. Any quicker way? > > 1) Postgres version? > > 2) Data going into single table or multiple tables? > > 3) What is the time frame you are trying to achieve? > > 4) What techniques have you tried? > > 5) If you need only 1GB why the 400GB number? > > > > > > > > Thanks. > > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > > > Hello, > > Sorry 400GB was a typo. Its 400 MB Details are below: > > 1) Postgres version? > 9.6 > > 2) Data going into single table or multiple tables? > Single table having Multiple columns > > 3) What is the time frame you are trying to achieve? > As quick as possible. > > 4) What techniques have you tried? > Insert into with With statement, inserting 2000000 rows at a time. This > takes 40 mins. Might take a look at COPY: https://www.postgresql.org/docs/11/sql-copy.html or its psql equivalent: \copy. COPY runs as the server user and sees files relative to the server location. \copy runs as the psql(client) user. In either case suitability will depend on where you are sourcing the test data from and what format it is in to begin with. If you want a more sophisticated wrapper over the above then: https://ossc-db.github.io/pg_bulkload/pg_bulkload.html > > 5) If you need only 1GB why the 400GB number? > That was 400MB. M checking size using \l+ option. > > > Thanks. > > -- Adrian Klaver adrian.klaver@aklaver.com