pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #6702: SELECT Query on INDEX
3+ messages / 3 participants
[nested] [flat]
* BUG #6702: SELECT Query on INDEX
@ 2012-06-22 01:19 alokrawat0212@gmail.com
0 siblings, 2 replies; 3+ messages in thread
From: alokrawat0212@gmail.com @ 2012-06-22 01:19 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 6702
Logged by: Alok Rawat
Email address: alokrawat0212@gmail.com
PostgreSQL version: 9.1.0
Operating system: WIN 7
Description:
Hello all,
I created a Index in postgres.Now i want to fire select query in this Index
and check data.
Please tell me how to perform this???
Thanks in advance,
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #6702: SELECT Query on INDEX
@ 2012-06-22 15:02 Ryan Kelly <rpkelly22@gmail.com>
parent: alokrawat0212@gmail.com
1 sibling, 0 replies; 3+ messages in thread
From: Ryan Kelly @ 2012-06-22 15:02 UTC (permalink / raw)
To: alokrawat0212@gmail.com; +Cc: pgsql-bugs
On Fri, Jun 22, 2012 at 01:19:50AM +0000, alokrawat0212@gmail.com wrote:
> The following bug has been logged on the website:
>
> Bug reference: 6702
> Logged by: Alok Rawat
> Email address: alokrawat0212@gmail.com
> PostgreSQL version: 9.1.0
> Operating system: WIN 7
> Description:
>
> Hello all,
>
> I created a Index in postgres.Now i want to fire select query in this Index
> and check data.
This is not a bug. For general questions regarding PostgreSQL, please
use the pgsql-general mailing list.
> Please tell me how to perform this???
PostgreSQL will automatically use your index when querying the table
that has that index, when appropriate. One does not query an index
directly. You might want to understand how to use EXPLAIN to see if your
index is being utilized. See the documentation at:
http://www.postgresql.org/docs/9.1/static/indexes.html
http://www.postgresql.org/docs/9.1/static/using-explain.html
>
> Thanks in advance,
>
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
-Ryan Kelly
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #6702: SELECT Query on INDEX
@ 2012-06-22 15:12 Kevin Grittner <Kevin.Grittner@wicourts.gov>
parent: alokrawat0212@gmail.com
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Grittner @ 2012-06-22 15:12 UTC (permalink / raw)
To: alokrawat0212@gmail.com; pgsql-bugs
<alokrawat0212@gmail.com> wrote:
> I created a Index in postgres.Now i want to fire select query in
> this Index and check data.
>
> Please tell me how to perform this???
This is not a bug. Please post any follow-ups or similar questions
to pgsql-general or pgsql-novice; or if it is a performance
question, try pgsql-performance.
To answer the question, as long as we're here, PostgreSQL uses a
cost-based optimizer -- so it will consider using the index on any
queries for the table which reference indexed columns. On a tiny
table (a few thousand rows or less), or if you are selecting more
than about 10% of the rows from the table, it is unlikely to use the
index because a simple scan of the heap is almost always faster.
Load up the tables with a lot of data and select for equality
against an indexed column using a value present in a small number of
rows, and you are likely to see the index used.
If you think the optimizer is not choosing the fastest plan, please
read this page:
http://wiki.postgresql.org/wiki/SlowQueryQuestions
-Kevin
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2012-06-22 15:12 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-06-22 01:19 BUG #6702: SELECT Query on INDEX alokrawat0212@gmail.com
2012-06-22 15:02 ` Ryan Kelly <rpkelly22@gmail.com>
2012-06-22 15:12 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
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