pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Igor Korot <ikorot01@gmail.com>
Cc: Atul Kumar <akumar14871@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Date: Fri, 02 Jul 2021 11:22:32 -0400
Message-ID: <819625.1625239352@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+FnnTyjs7tL6b6KVANxwN6TPmQ8-QcUWt=E2qsk=6gUrXkL0g@mail.gmail.com>
References: <CA+ONtZ7rwscWc-=wE3jBG6Xx47siPc8=5qOoyX4EJsi38YaLeA@mail.gmail.com>
	<CA+FnnTyjs7tL6b6KVANxwN6TPmQ8-QcUWt=E2qsk=6gUrXkL0g@mail.gmail.com>

Igor Korot <ikorot01@gmail.com> writes:
> On Fri, Jul 2, 2021, 5:24 AM Atul Kumar <akumar14871@gmail.com> wrote:
>> ->  Seq Scan on sam_participant pp  (cost=0.00..777393.87 rows=56113 width=10) (actual time=0.277..10869.750 rows=2335154 loops=1)
>>       Filter: ((igroupid)::integer = (current_setting('env.groupid'::text))::integer)

>> I have already an index on the column igroupid of table
>> sam_participant, but still it is doig seq scan, which is time
>> consuming or is their something else is fishy.

Where is that cast to integer coming from?  That's likely causing
the WHERE clause to not match your index.  What's the actual type
of the igroupid column?

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <819625.1625239352@sss.pgh.pa.us>
Permalink:  ../819625.1625239352@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/819625.1625239352@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ikorot01@gmail.com, akumar14871@gmail.com
  Subject: Re: 
  In-Reply-To: <819625.1625239352@sss.pgh.pa.us>
  References: <CA+ONtZ7rwscWc-=wE3jBG6Xx47siPc8=5qOoyX4EJsi38YaLeA@mail.gmail.com> <CA+FnnTyjs7tL6b6KVANxwN6TPmQ8-QcUWt=E2qsk=6gUrXkL0g@mail.gmail.com> <819625.1625239352@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox