EXPLAIN on DELETE statements

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Janning Vygen

    EXPLAIN on DELETE statements

    Hi,

    EXPLAIN on delete stamements works, but doesn't show me all the subsequent
    deletes or checks which has to be done because of foreign keys
    cascading/restricting.

    Is there a solution to show up which tables are checked and which scans the
    planner is going to use to check these related tables?

    kind regards,
    janning



    ---------------------------(end of broadcast)---------------------------
    TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddres sHere" to majordomo@postg resql.org)

  • Grant McLean

    #2
    Re: EXPLAIN on DELETE statements

    On Wed, 2004-07-28 at 23:41, Janning Vygen wrote:[color=blue]
    > Hi,
    >
    > EXPLAIN on delete stamements works, but doesn't show me all the subsequent
    > deletes or checks which has to be done because of foreign keys
    > cascading/restricting.
    >
    > Is there a solution to show up which tables are checked and which scans the
    > planner is going to use to check these related tables?[/color]

    You could try enabling the 'log_statement' and related entries in the
    postgresql.conf file and possibly the -d option for debugging on the
    Postmaster. I know I get the referential integrity check queries
    showing up in the PostgreSQL log (syslog actually) on my server but I'm
    not exactly sure what I did to cause that :-). Here's an example:

    LOG: statement: SELECT 1 FROM ONLY "public"."audit _type" x WHERE
    "audit_type _id" = $1 FOR UPDATE OF x

    Regards
    Grant



    ---------------------------(end of broadcast)---------------------------
    TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddres sHere" to majordomo@postg resql.org)

    Comment

    Working...