Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009
    Posts
    2

    Unanswered: Index scan versus seek

    I am looking at the query plans for some of my postgres queries and i only see index scans or sequential scans. Doesn't postgres have a concept of seek? What do I need to do to make it use an index seek? I have read a lot of the documentation but can't find any reference to an index seek.

    Any help appreciated.
    Thanks

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by mridula_m View Post
    IDoesn't postgres have a concept of seek?
    I have no idea what you mean with "seek"?
    Can you explain what you are looking for?

  3. #3
    Join Date
    Dec 2009
    Posts
    2
    Thanks for the response.
    SQL Serverfor eg: differenciates between a index seek versus a scan. A scan would go thru the entire index while a seek would look for certain entries.
    Wondering if postgresql has a concept similar to that. (doesn't sound like it from your response).

    -mridula

  4. #4
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by mridula_m View Post
    differenciates between a index seek versus a scan. A scan would go thru the entire index while a seek would look for certain entries.
    I still don't see a difference.
    And besides: going through the entire index nearly never makes sense, because that means you'll want all rows anyway. So a full table scan will probably be more efficient.
    The only reason for scanning an entire index could be sorting.

    But if you are looking for a difference between "scanning" a range of index entries vs. picking a single row from an index, then I think the equivalent in Postgres is a Bitmap Index Scan vs. an Index Scan.

    You might want to go through the documents here:
    Using EXPLAIN - PostgreSQL Wiki

    or if you are really interested in the technical details you should post this question to the PG mailing list. The developers (especially Tom Lane) are monitoring that and are extremely helpful
    If you want to get the explanation from the "horse's mouth" that's the place to ask.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •