Jan, > Hmmm ... what type of foreign key lookup would that be? None of the RI > generated queries has any order by clause. I was under the impression that work_mem would be used for the index if there was an index for the RI lookup. Wrong? -- --Josh Josh Berkus Aglio Database Solutions San Francisco