Re: Why the planner does not use index for a large amount of data? - Mailing list pgsql-general

From Melvin Davidson
Subject Re: Why the planner does not use index for a large amount of data?
Date
Msg-id CANu8Fixr-A=zt-3aqvaFSGchdd+cU6L0jwyz7cCnTmXQ34MpPA@mail.gmail.com
Whole thread Raw
In response to Why the planner does not use index for a large amount of data?  (hmidi slim <hmidi.slim2@gmail.com>)
List pgsql-general


On Wed, Dec 6, 2017 at 9:37 AM, hmidi slim <hmidi.slim2@gmail.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.

pgsql-general by date:

Previous
From: hmidi slim
Date:
Subject: Why the planner does not use index for a large amount of data?
Next
From: "David G. Johnston"
Date:
Subject: Re: Why the planner does not use index for a large amount of data?