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

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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

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!

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

Quoted text here. Click to load it


fine so far.

Quoted text here. Click to load it

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)

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?

Re: help needed - insert to oracle is sooo slow :-( wrote:
Quoted text here. Click to load it

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.



Site Timeline