Hi, Strk, strk at refractions.net wrote: > I would be surprised if you get that function to use an index. > Did you verify it ? I would not be so surprised, as it is in defined in the 'sql' language as opposed to 'plpgsql'. I remember having read that the query planner is able to inline 'sql' language functions before optimizing the query plan. Markus