On Wed, Nov 17, 2004 at 12:41:20PM +1100, Harvey, Allan AC wrote: > mill2=> explain analyse select count(*) from history where pointname = 'MILL2-SPEED' and dt > (now() - interval '5 minutes')::timestamp\g How typical is this query? How many distinct values does pointname have? Have you considered adding an index on pointname or a multicolumn index on pointname and dt? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match