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*

13
  • @a_horse_with_no_name already, tried that, doesn't seem to make a difference. Version added in opeing post. Commented Nov 12, 2019 at 17:27
  • Your query wants all the records. It would need all the record for an index-only scan, too. (but maybe the rowsize could differ?) Commented Nov 12, 2019 at 17:31
  • 1
    Mybe your random_page_cost is set too high.(factory default is 4.0, for ssd / NAS you can lower it to below 2) Commented Nov 12, 2019 at 18:10
  • 1
    There are several parameters about query planner As I know for modern SSD devices random_page_cost should be 2 Note that it could to be set at runtime, so just before your query execute set random_page_cost to 2; Commented Nov 12, 2019 at 18:15
  • 1
    "Group (cost=37860.49..41388.54 rows=14802 width=15) (actual time=4285.530..7459.872 rows=999766 loops=1)" Do you know why this estimate is so wrong? Commented Nov 12, 2019 at 21:17