Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx> writes:
> Using the second plan the query is returning tuples where
> a=F1o_semestre <> 20071
You seem to have worse problems than that, because as given the
insc_registra_grupo function never returns non-NULL, and so the
query ought not be returning any tuples at all. I suspect pilot
error --- perhaps looking at the wrong schema or some such?
regards, tom lane