Re: Why the planner does not use index for a large amount of data?

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: hmidi slim <hmidi(dot)slim2(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, pgsql-docs(at)postgresql(dot)org
Subject: Re: Why the planner does not use index for a large amount of data?
Date: 2017-12-06 14:47:00
Message-ID: CANu8Fixr-A=zt-3aqvaFSGchdd+cU6L0jwyz7cCnTmXQ34MpPA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-general

On Wed, Dec 6, 2017 at 9:37 AM, hmidi slim <hmidi(dot)slim2(at)gmail(dot)com> wrote:

> Hi,
> When I used explain I found that the query planner use a seq scan to
> execute a query on a table containing about 2 millions rows.However I'm
> creating an index.Why does the planner uses seq scan in place of index
> scan?Does the execution of index scan is slower with table containing a
> huge amount of data?
>

>Why does the planner uses seq scan in place of index scan?

It is strongly suggested that you provide the PostgreSQL version and O/S
when posing questions to this mail list.
In addition, your question cannot be answered unless you also provide
A. The explain plan in question.
B. The structure of all indexes involved
C, Have you run ANALYZE on all tables involved?

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2017-12-06 14:52:09 Re: Why the planner does not use index for a large amount of data?
Previous Message tibor.foris 2017-12-06 14:40:01 njobs

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2017-12-06 14:52:09 Re: Why the planner does not use index for a large amount of data?
Previous Message hmidi slim 2017-12-06 14:37:21 Why the planner does not use index for a large amount of data?