On 9/19/06, P Kishor <[EMAIL PROTECTED]> wrote:

    CREATE VIEW v_attr AS
      SELECT pt.id AS pt_id, Count(pt.id) AS pt_id_count, py.attr AS py_attr
      FROM pt JOIN py ON
        (
          (pt.x BETWEEN py.xmin AND py.xmax) AND
          (pt.y BETWEEN py.ymin AND py.ymax)
        )
      GROUP BY pt_id_count
      HAVING pt_id_count = 1
    )


Since you have a count() and a group by it's going to have to execute
the entire query, then summarize the results, before it can produce even
a single row of result.

Views are generally used (at least by me) to gain efficiency in retrieval.
I don't do updates to views. They're generally difficult to use that way
and I avoid it. If you can, always update the base tables.

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to