On Fri, Dec 26, 2008 at 07:13:48PM -0500, Tom Lane wrote: > Ivan Sergio Borgonovo <mail@xxxxxxxxxxxxxxx> writes: > >>> David Fetter <david@xxxxxxxxxx> wrote: > >>>> In 8.4, you'll be able to do: > > >>>> WITH d AS ( > >>>> SELECT DISTINCT c1, c2 FROM table1 > >>>> ) > >>>> SELECT count(*) FROM d; > > >>> Nice, but what will be the difference from > >>> select count(*) from (select distinct c1, c2 from t); > >>> ? > >>> Optimisation? > > >> None especially. > > > So what would be the advantage compared to subselect? > > None, David just has WITH on the brain ;-) LOL! You're only saying that because it's true ;) Cheers, David. -- David Fetter <david@xxxxxxxxxx> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@xxxxxxxxx Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general