Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    What do you see if you create a btree index on triples.object? Also, which PostgreSQL version do you use? Commented Oct 17, 2013 at 13:25
  • I added the btree index, removed the hash index, analyzed again but no noticeable difference. Commented Oct 17, 2013 at 19:47
  • Index lookups are reported to take 5.75ms, which indeed is slow. Try explain (analyze,buffers) select... to get information on how much is actually read from disk versus buffers. I would run vmstat 1 during the query to also see at which rate data is pulled from disk during these 40s and how much I/O-wait occurs. Commented Oct 18, 2013 at 15:27
  • @DanielVérité It's PostgreSQL 8, so unfortunately I can't do buffers. Here is the output of vmstat 1: pastebin.com/dLmuJmgY Commented Oct 18, 2013 at 16:47