Re: is it possible to make this faster?

Поиск
Список
Период
Сортировка
Искать
От
Mark Lewis
Тема
Re: is it possible to make this faster?
Дата
в 18:26:38
Msg-id
1148592384.9750.13.camel@archimedes
Ответ на
Список
Дерево обсуждения
is it possible to make this faster? "Merlin Moncure" <mmoncure@gmail.com>
Re: is it possible to make this faster? Tom Lane <tgl@sss.pgh.pa.us>
Re: is it possible to make this faster? Scott Marlowe <smarlowe@g2switchworks.com>
Re: is it possible to make this faster? Mark Lewis <mark.lewis@mir3.com>
Re: is it possible to make this faster? Tom Lane <tgl@sss.pgh.pa.us>
Re: is it possible to make this faster? Jim Nasby <jnasby@pervasive.com>
Re: is it possible to make this faster? Tom Lane <tgl@sss.pgh.pa.us>
Re: is it possible to make this faster? "Merlin Moncure" <mmoncure@gmail.com>
Re: is it possible to make this faster? Tom Lane <tgl@sss.pgh.pa.us>
Re: is it possible to make this faster? "Merlin Moncure" <mmoncure@gmail.com>
Re: is it possible to make this faster? Tom Lane <tgl@sss.pgh.pa.us>
Re: is it possible to make this faster? "Merlin Moncure" <mmoncure@gmail.com>
Re: is it possible to make this faster? Tom Lane <tgl@sss.pgh.pa.us>
Re: is it possible to make this faster? "Merlin Moncure" <mmoncure@gmail.com>
Re: is it possible to make this faster? Tom Lane <tgl@sss.pgh.pa.us>
Re: is it possible to make this faster? Mark Kirkwood <markir@paradise.net.nz>
Re: is it possible to make this faster? Bruno Wolff III <bruno@wolff.to>
Re: is it possible to make this faster? "Merlin Moncure" <mmoncure@gmail.com>
Re: is it possible to make this faster? Alan Hodgson <ahodgson@simkin.ca>
Re: is it possible to make this faster? Bruno Wolff III <bruno@wolff.to>
Re: is it possible to make this faster? "Steinar H. Gunderson" <sgunderson@bigfoot.com>
Re: is it possible to make this faster? Jeff - <threshar@torgo.978.org>
Re: is it possible to make this faster? Tom Lane <tgl@sss.pgh.pa.us>
Re: is it possible to make this faster? "Merlin Moncure" <mmoncure@gmail.com>
Re: is it possible to make this faster? "Steinar H. Gunderson" <sgunderson@bigfoot.com>
On Thu, 2006-05-25 at 16:52 -0400, Tom Lane wrote:
> "Merlin Moncure"  writes:
> > been doing a lot of pgsql/mysql performance testing lately, and there
> > is one query that mysql does much better than pgsql...and I see it a
> > lot in normal development:
> 
> > select a,b,max(c) from t group by a,b;
> 
> > t has an index on a,b,c.
> 
> The index won't help, as per this comment from planagg.c:
> 
> 	 * We don't handle GROUP BY, because our current implementations of
> 	 * grouping require looking at all the rows anyway, and so there's not
> 	 * much point in optimizing MIN/MAX.
> 
> Given the numbers you mention (300k rows in 2000 groups) I'm not
> convinced that an index-based implementation would help much; we'd
> still need to fetch at least one record out of every 150, which is
> going to cost near as much as seqscanning all of them.

Well, if the MySQL server has enough RAM that the index is cached (or
index + relevant chunks of data file if using InnoDB?) then that would
explain how MySQL can use an index to get fast results.

-- Mark Lewis
В списке pgsql-performance по дате отправления
От: Scott Marlowe
Дата:
От: Jim Nasby
Дата:
FAQ