Re: Weird issue with planner choosing seq scan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sean Leach <sleach@xxxxxxxxxx> writes:
> I have a table, that in production, currently has a little over 3  
> million records in production.  In development, the same table has  
> about 10 million records (we have cleaned production a few weeks  
> ago).

You mean the other way around, to judge by the rowcounts from EXPLAIN.

>           ->  Index Scan using u_counts_i2 on u_counts c   
> (cost=0.00..53.53 rows=1082 width=4) (actual time=0.277..1224.582  
> rows=392173 loops=1)

I kinda think the devel system wouldn't be using an indexscan either
if it had up-to-date ANALYZE statistics.  But even with the 1082 row
estimate that seems a remarkably low cost estimate.  Have you been
playing games with random_page_cost?  Maybe you forgot to duplicate the
devel system's cost parameters onto the production system?

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux