Jayadevan M wrote: > Here is the explain analyze > http://explain.depesz.com/s/MY1 > PostgreSQL 9.0.4 on x86_64-pc-solaris2.10 > work_mem = 96MB Thanks for posting the query and related schema. I tried working through it, but I keep coming back to this sort, and wondering how a sort can have 1121 rows as input and 2673340321 rows as output. Does anyone have any ideas on what could cause that? -> Sort (cost=1895.95..1896.49 rows=215 width=61) (actual time=25.926..711784.723 rows=2673340321 loops=1) Sort Key: memmst.memshpsta Sort Method: quicksort Memory: 206kB -> Nested Loop (cost=0.01..1887.62 rows=215 width=61) (actual time=0.088..23.445 rows=1121 loops=1) -Kevin -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance