Re: Using max() MUCH slower in v7.1
| От | Robert B. Easter |
|---|---|
| Тема | Re: Using max() MUCH slower in v7.1 |
| Дата | |
| Msg-id | 01011715533009.02219@comptechnews обсуждение исходный текст |
| Ответ на | Re: Using max() MUCH slower in v7.1 (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-general |
On Wednesday 17 January 2001 12:29, Tom Lane wrote: > "Gordan Bobic" <gordan@freeuk.com> writes: > > CREATE VIEW LastDate AS > > SELECT Company, > > max(Date) AS Date > > FROM PastInvoices > > GROUP BY Company; > > > > And then call it like > > SELECT Date FROM LastDate ORDER BY Date WHERE Company = 'SomeCompany'; > > > > It takes ABSOLUTELY forever. The table has about 25-30M records. As long as you are selecting a specific company with that WHERE clause, isn't that ORDER BY unnecessary? -- -------- Robert B. Easter reaster@comptechnews.com --------- -- CompTechNews Message Board http://www.comptechnews.com/ -- -- CompTechServ Tech Services http://www.comptechserv.com/ -- ---------- http://www.comptechnews.com/~reaster/ ------------
В списке pgsql-general по дате отправления: