| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | "Merlin Moncure" <mmoncure(at)gmail(dot)com> |
| Cc: | "Postgresql Performance" <pgsql-performance(at)postgresql(dot)org> |
| Subject: | Re: is it possible to make this faster? |
| Date: | 2006-05-26 17:07:39 |
| Message-ID: | 27137.1148663259@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
"Merlin Moncure" <mmoncure(at)gmail(dot)com> writes:
> did you have a key on a,b,c?
Yeah, I did
create index t1i on t1 (a,b,c);
Do I need to use some other syntax to get it to work?
> select count(*) from (select a,b,max(c) group by a,b) q;
> blows the high performance case as does putting the query in a view.
I noticed that too, while trying to suppress the returning of the
results for timing purposes ... still a few bugs in their optimizer
obviously. (Curiously, EXPLAIN still claims that the index is being
used.)
> mysql> select user_id, acc_id, max(sample_date) from usage_samples group by 1,2
> [...]
> +---------+--------+------------------+
> 939 rows in set (0.07 sec)
> mysql> select user_id, acc_id, max(sample_date) from usage_samples group by 1,2
> [...]
> +---------+--------+------------------+--------------+
> 939 rows in set (1.39 sec)
I don't understand what you did differently in those two cases?
Or was there a DROP INDEX between?
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Merlin Moncure | 2006-05-26 17:46:30 | Re: is it possible to make this faster? |
| Previous Message | Merlin Moncure | 2006-05-26 16:56:44 | Re: is it possible to make this faster? |