Andrey Repko wrote:
I have table ma_data, that contain above 300000 rows.
This table has primary key id, and field alias_id.
I create index (btree)on this field.
Set statistic:
ALTER TABLE "public"."ma_data"
ALTER COLUMN "alias_id" SET STATISTICS 998;
So, when I do something like
SELECT alias_id FROM ma_data GROUP BY alias_id
Why are you using GROUP BY without any aggregate functions?
What happens if you use something like
SELECT DISTINCT alias_id FROM ma_data;
--
Richard Huxton
Archonet Ltd
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq