In my opinion it all depends on idexes you have.

If when doing a select/update you are using a where clause on an
indexed column then it will be fast, but if you use a where clause on
an unindexed column then it will be slower. Please note that if column
being updated is indexed then it will be a bit slower since that index
will need to be recaculated.

On the other hand if you make an insert in a table that has no indexes
then it will be fast as records are simply added. But if you make an
insert in a table that has one or mores indexes then these indexes
must be updated with each row inserted and hence will become slower.

Deletes is a bit of a compromise. When deleting using a where clause
on a column that is indexed then it will be fast to located row/s, but
after delete index will need to be recalculated.

As a simply general rule it is best to have a lot of indexes when you
have a lot or selects and updates(on non-indexed columns example data
warehouse), but indexes must be kept to a minimum when you have a lot
of inserts and fewer selects/updates.

James.

On Jan 2, 4:46 am, Venu Yanamandra <yanamandra.v...@gmail.com> wrote:
> I also thought about it once again and think I might be wrong about the redo
> information. 'coz they all fall under DML, there should be redo recorded.
> But, somehow insert must be cheaper as there is no where clause to be
> validated when we consider the worst case scenario. i.e., delete can have
> where clause, while insert does not.
>
> On Fri, Jan 1, 2010 at 9:41 PM, Venu Yanamandra
> <yanamandra.v...@gmail.com>wrote:
>
>
>
> > i think insert is cheaper than delete/update.
> > with insert, only the constraints are validated.
> > with delete, the records are searched, redo information is recorded,
> > etc.
> > with update, the records are searched, redo information is recorded,
> > the constraints are validated again, etc.
>
> > -Venu
>
> > On Nov 26 2009, 8:47 am, Niraj Singh The King
> > <parihar.nirajsi...@gmail.com> wrote:
> > > As per my knowledge goes insert are less expensive as while doing update
> > and
> > > delete it needs to search for the records while inserting it dont needs
> > > until there are some constraints but still they are less expensive
> > > --
> > > Thanks and Regards,
> > > Opus Software Solution(Pune)
> > > Niraj Singh Parihar
> > > Mobile Number : +919890492566.
>
> > > On Thu, Nov 26, 2009 at 8:57 AM, Javier Montani <jmont...@gmail.com>
> > wrote:
> > > > It also depends on how many records and indexes the table has. With too
> > > > many records an update of a column that doesn't belong to an index
> > could be
> > > > faster than an insert which has to update all the indexes.
>
> > > > 2009/11/25 Andrej Hopko <ado.ho...@gmail.com>
>
> > > > Hi,
> > > >>     my standard knowledge is that inserts are cheap for database to
> > > >> run, but deleting and updating are expensive operations (if this you
> > > >> meant by fat operation)
>
> > > >>     difference is mainly due to usage of indexes and locks (thats my
> > > >> opinion)
>
> > > >>         hoppo
>
> > > >> On 25.11.2009 23:16, noam gariani wrote:
> > > >> > Do you know what is fater?
> > > >> > To do update for a record , or insert a record to a db?
>
> > > >> --
> > > >> You received this message because you are subscribed to the Google
> > > >> Groups "Oracle PL/SQL" group.
> > > >> To post to this group, send email to Oracle-PLSQL@googlegroups.com
> > > >> To unsubscribe from this group, send email to
> > > >> oracle-plsql-unsubscr...@googlegroups.com
> > > >> For more options, visit this group at
> > > >>http://groups.google.com/group/Oracle-PLSQL?hl=en
>
> > > >  --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "Oracle PL/SQL" group.
> > > > To post to this group, send email to Oracle-PLSQL@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > oracle-plsql-unsubscr...@googlegroups.com
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/Oracle-PLSQL?hl=en-Hide quoted text -
>
> > > - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Oracle PL/SQL" group.
> > To post to this group, send email to Oracle-PLSQL@googlegroups.com
> > To unsubscribe from this group, send email to
> > oracle-plsql-unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/Oracle-PLSQL?hl=en- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en

Reply via email to