Martin Marques escribió: > Martin Marques escribió: >> Pavel Stehule wrote: >>> >>> try >>> >>> set work_mem to '8MB'; >>> and >>> explain analyze select .. >> These things didn't help. What changed the plan completely was this: >> seq_page_cost = 5.0 # measured on an arbitrary scale >> cpu_tuple_cost = 0.05 # same scale as above > > Can someone explain how this parameters are measured? What is 5.0 in this > case for seq_page_cost? It's an arbitrary number, based on which all the other numbers are measured. What people generally do around here is mess with random_page_cost, and leave seq_page_cost alone. Often, it's the ratio seq_page_cost/random_page_cost what's most important to the cost equations results. (seq_page_cost wasn't tunable at all until recently, say 8.1 or 8.2 AFAIR). -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq