Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxSKV-0004v4-Br for pgsql-sql@arkaria.postgresql.org; Thu, 07 Jan 2021 10:15:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kxSKU-0007mm-A4 for pgsql-sql@arkaria.postgresql.org; Thu, 07 Jan 2021 10:15:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxSKU-0007mf-3i for pgsql-sql@lists.postgresql.org; Thu, 07 Jan 2021 10:15:42 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kxSKR-0000xy-S4 for pgsql-sql@lists.postgresql.org; Thu, 07 Jan 2021 10:15:41 +0000 Received: by mail-pg1-x533.google.com with SMTP id n10so4501277pgl.10 for ; Thu, 07 Jan 2021 02:15:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=qQXC7O8jB4YJ5uLWEoP+owYzM9NdIdz+ZL+qncfA2og=; b=cmayU1kJ7+TTM5PFV9qJqgnT2qXqb/ajr/ylFyEsxMEaUhvBDf10CRV4A6zdJF9aR7 1cCPadkjQ8a+R00dq5nPyDxg2dG12basDhlcXy8z1P4FDbGCJK/6eJsIeQwFumlZ594y J//7b4PX5QKaGenz6bCGJdA7OUM9CW3oVWOoJOV1BlCV5gjXMSMFK3OIB04akasgrkB8 D4yXxeD5PgONuuPVega6IyxcZ/gQ0DgEo16OoEM3yrxin4A9l5w5/j0NaHRiLnqN7F+J Vs8eNGrxKCIeroS0GMm60USac/6lvRyOpmoFtlAfXma4zkri+B20xIEl+h9xrWkPK4vb LFmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=qQXC7O8jB4YJ5uLWEoP+owYzM9NdIdz+ZL+qncfA2og=; b=k6T0Ab6ASOknWTlwv4HjaWJLFLVrZqt3ENiENK1mc69bbddCpdw6q87rRR1wscyyXt 50BSQvS4TRGr4t12g4kIC2saOHa1Px/QvG89ED5I4O8rQV/OO9L5rZJpU1evYv5NOAKb GbdmGWRE3h48iq2QSeDoAluQVFQLWvUAbFo8LeWqQHO3GhXsih9wj9wVACy3O09qtn5n GgNBWCzgms8had2udaQloU0gn6YVjzqYc8C9vonSZ+urPlafnlSicBoHB7eLgZKTss8e i/CY5hVEv3u/b1f89iYQAeAvYY2ZpPBFCJ7FPyTn1ztSjJ76QszxQ/QFCE86Rd77T935 fRTg== X-Gm-Message-State: AOAM531EIaqDYSXfjJlQ7H3W5LOpnIh6Z+QDhnW/95v+KqUDrsM3hblG LLI1bkvonYnqHLRvu0JxrCL5HXit50g1DaBwHH1seB6w78CZApGt X-Google-Smtp-Source: ABdhPJzzGPe7qM99OPGu5zMzSdWKUbpyEFftoGa5D8jXaGK+VtQzFlGQUGbpZQqpL0yRP/ALjEc6ChsFmzhC/1MqSPM= X-Received: by 2002:a65:6713:: with SMTP id u19mr1150623pgf.364.1610014538045; Thu, 07 Jan 2021 02:15:38 -0800 (PST) MIME-Version: 1.0 From: Sachin Kumar Date: Thu, 7 Jan 2021 15:45:02 +0530 Message-ID: Subject: how to make query To: pgsql-sql@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000009f9fcb05b84cb881" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000009f9fcb05b84cb881 Content-Type: text/plain; charset="UTF-8" Hi Team, we are using Python Django and Postgresql. Our requirement is to search 10 Million Card data and bring specific records as a result after checking the record every time. We have to find data from a 2nd table that is related to the first one which we are checking using the loop. For Ex:- 10000 data - loop 10000 times to find data from the 2nd table. This makes our query too slower and it gets time out. -- Best Regards, Sachin Kumar --0000000000009f9fcb05b84cb881 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Team,

we are using Python Django and= Postgresql. Our requirement is to=C2=A0search 10 Million Card data and bri= ng specific records as a result after checking the record every time.
=

We have to find data from a 2nd table that is related t= o the first one which we are checking using the loop.

<= div>For Ex:-=C2=A0
10000 data - loop 10000 times=C2=A0
= to find data from the 2nd table.=C2=A0

This makes = our query too slower and it gets time out.

--
Best Regards,
Sachin Kumar
--0000000000009f9fcb05b84cb881--