Re: timestamp with time zone
От
Tom Lane
Тема
Re: timestamp with time zone
Дата
Msg-id
7688.1328854792@sss.pgh.pa.us
Ответ на
Re: timestamp with time zone (Alessandro Gagliardi)
Список
Дерево обсуждения
timestamp with time zone Alessandro Gagliardi <alessandro@path.com>
Re: timestamp with time zone Tom Lane <tgl@sss.pgh.pa.us>
Re: timestamp with time zone Alessandro Gagliardi <alessandro@path.com>
Re: timestamp with time zone "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: timestamp with time zone Alessandro Gagliardi <alessandro@path.com>
Re: timestamp with time zone Tom Lane <tgl@sss.pgh.pa.us>
Re: timestamp with time zone Alessandro Gagliardi <alessandro@path.com>
Alessandro Gagliardi writes: > Still slow as mud: http://explain.depesz.com/s/Zfn > Now I've got indices on created, timezone, created at time zone timezone, > and (created at time zone timezone)::date. Clearly the problem isn't a lack > of indices!...except, wait, it's not actually using blocks_created_date_idx > (or blocks_created_at_timezone_idx). How do I make that happen? Did you ANALYZE the table after creating those indexes? Generally you need an ANALYZE so that the planner will have some stats about an expression index. It might still think that the other index is a better option. In that case you can experiment to see if it's right or not; the general idea is begin; drop index index_that_planner_prefers; explain analyze your_query; rollback; -- revert the index drop If that EXPLAIN isn't actually any better than what you had, then the planner was right. If it is better, let's see 'em both. regards, tom lane
В списке pgsql-performance по дате отправления