Re: does "select count(*) from mytable" always do a seq
От
Pierre-Frédéric Caillaud
Тема
Re: does "select count(*) from mytable" always do a seq
Дата
Msg-id
opska7u2ixcq72hf@musicbox
Ответ на
Re: does "select count(*) from mytable" always do a seq (Alex Turner)
Список
Дерево обсуждения
does "select count(*) from mytable" always do a seq scan? Culley Harrelson <harrelson@gmail.com>
Re: does "select count(*) from mytable" always do a seq Tino Wildenhain <tino@wildenhain.de>
Re: does "select count(*) from mytable" always do a seq Bruno Wolff III <bruno@wolff.to>
Re: does "select count(*) from mytable" always do a seq scan? Culley Harrelson <harrelson@gmail.com>
Re: does "select count(*) from mytable" always do a seq scan? Alex Turner <armtuk@gmail.com>
Re: does "select count(*) from mytable" always do a seq Scott Ribe <scott_ribe@killerbytes.com>
Re: does "select count(*) from mytable" always do a seq Alex Turner <armtuk@gmail.com>
Re: does "select count(*) from mytable" always do a seq Scott Ribe <scott_ribe@killerbytes.com>
Re: does "select count(*) from mytable" always do a seq Alex Turner <armtuk@gmail.com>
Re: does "select count(*) from mytable" always do a seq Bruno Wolff III <bruno@wolff.to>
Re: does "select count(*) from mytable" always do a seq Alex Turner <armtuk@gmail.com>
Re: does "select count(*) from mytable" always do a seq Alvaro Herrera <alvherre@dcc.uchile.cl>
Re: does "select count(*) from mytable" always do a seq Bruno Wolff III <bruno@wolff.to>
Re: does "select count(*) from mytable" always do a seq Michael Fuhr <mike@fuhr.org>
Re: does "select count(*) from mytable" always do a seq Pierre-Frédéric Caillaud<lists@boutiquenumerique.com>
> (The example is really count(pkey) because count(*) is always going to > do a seq scan I reckon - and could probably never use an index). postgres knows that count(*) is just "count the rows", you can use count(1), it makes no difference... > > Alex Turner > NetEconomist > > > On Fri, 07 Jan 2005 11:17:32 -0700, Scott Ribe > wrote: >> > I guess what I"m really asking is why can't you run aggregates over >> an index? >> >> It's got to do with MVCC and transaction consistency. Running count(*) >> or an >> aggregate function on an index could include records that should not be >> visible to your current transaction. >> >> -- >> Scott Ribe >> scott_ribe@killerbytes.com >> http://www.killerbytes.com/ >> (303) 665-7007 voice >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 8: explain analyze is your friend >> > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend >
В списке pgsql-general по дате отправления