What is T and how many rows are in there? How many rows in task_history?What indexes exist? Are you confident you want 2 million rows in thatresult set? What version is this on? What pg_settings have been changedfrom defaults?