Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3C890476184 for ; Sat, 17 Aug 2002 21:55:39 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 9033C47617B for ; Sat, 17 Aug 2002 21:55:38 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g7I1tPVk007209; Sat, 17 Aug 2002 21:55:25 -0400 (EDT) To: "JOE" Cc: pgsql-sql@postgresql.org Subject: Re: Unexplained SQL behavior In-reply-to: <018f01c24653$b23d8000$c801a8c0@joe> References: <018f01c24653$b23d8000$c801a8c0@joe> Comments: In-reply-to "JOE" message dated "Sat, 17 Aug 2002 18:07:59 -0700" Date: Sat, 17 Aug 2002 21:55:24 -0400 Message-ID: <7208.1029635724@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/256 X-Sequence-Number: 9102 "JOE" writes: > In the examples below I have a view with 10 columns. I run an explain plan= > and it uses the primary key of the driver table (enrollment table) as to b= > e expected and executes in 1.86 msec. When I added another columns (and it= > is a null value casted to a timestamp - LASTACCESSED) the execution plan n= > ow uses a totally different plan and now runs for 8622.16 msec. Anyone hav= > e any ideas or explination that may help understand?? --- thanks Seems odd to me too, but it's difficult to speculate without being able to try to reproduce the example. Could we see the full declarations of the tables involved? (pg_dump -s output would be good.) regards, tom lane