help needed - insert to oracle is sooo slow :-(

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cricketunes@yahoo.com

    help needed - insert to oracle is sooo slow :-(

    Hi everyone :)

    I have made a form to get values and insert them to a database.

    I have
    1) A file conn.php that does the initial connections
    2) The form file form.php
    3) Action file action.php which gets values from form.php to do
    insert/delete/update.

    I am 'including' conn.php in action.php since I need to connect to make
    an INSERT. However a simple INSERT takes a whole lot of time to
    execute. Often runs upto more than 2-3 minutes.

    Is there a faster and less complicated way to do it?

    Suggestions appreciated

    have a gud one!
    Benny

  • Erwin Moller

    #2
    Re: help needed - insert to oracle is sooo slow :-(

    cricketunes@yah oo.com wrote:
    [color=blue]
    > Hi everyone :)[/color]

    Hi
    [color=blue]
    >
    > I have made a form to get values and insert them to a database.
    >
    > I have
    > 1) A file conn.php that does the initial connections
    > 2) The form file form.php
    > 3) Action file action.php which gets values from form.php to do
    > insert/delete/update.[/color]

    fine so far.
    [color=blue]
    >
    > I am 'including' conn.php in action.php since I need to connect to make
    > an INSERT. However a simple INSERT takes a whole lot of time to
    > execute. Often runs upto more than 2-3 minutes.[/color]

    Well, in situations like this, the first thing to check is: Does the
    SQL-statement take so long, or is it something else?
    So, instead of letting your action.php execute the SELECT/INSERT/UPDATE,
    just print it before you execute it, then stop the script (exit).

    Then copy the SQL-statement, and paste it into SQL+ or whatever that Oracle
    interface is named these days.

    If you can execute the query very fast directly, you know that you have to
    look futher in the action.php script, or in the setup.


    Chances are that your insert is very slow because the database is huge and
    needs to do a lot of indexing and such.
    If that is the case, contact the builder and ask for help.

    If that is NOT the case, come back here, and show us more code. (Preferably
    the relevant parts in action.php)

    Regards,
    Erwin Moller

    PS: Maybe this is relevant, I am not sure because I am no Oracleguru. But in
    Postgresql it makes a huge difference in speed if you connect directly with
    UNIX-sockets instead of TCP/IP. Maybe Oracle has similar features?

    Comment

    • jerry gitomer

      #3
      Re: help needed - insert to oracle is sooo slow :-(

      cricketunes@yah oo.com wrote:[color=blue]
      > Hi everyone :)
      >
      > I have made a form to get values and insert them to a database.
      >
      > I have
      > 1) A file conn.php that does the initial connections
      > 2) The form file form.php
      > 3) Action file action.php which gets values from form.php to do
      > insert/delete/update.
      >
      > I am 'including' conn.php in action.php since I need to connect to make
      > an INSERT. However a simple INSERT takes a whole lot of time to
      > execute. Often runs upto more than 2-3 minutes.
      >
      > Is there a faster and less complicated way to do it?
      >
      > Suggestions appreciated
      >
      > have a gud one!
      > Benny
      >[/color]

      After you check out the timing using Erwin Moller's suggestion I
      believe you will find Oracle is very fast.

      If you want precise execution times check out the Oracle manuals
      for SQLPlus for getting time stamps before and after your query
      executes so that you can easily calculate the actual execution time.

      Based on how long it is taking your application to do the insert
      I suspect that your problem lies in connecting to your database.

      HTH

      Jerry

      Comment

      Working...