try adding DEBUG ON to your layer definition. It should printout the SQL mapserver is executing. Copy and paste this into the postgresql "psql" and see what happens (does it give an error, is it fast?). dave