Обсуждение: slow cursor

Поиск
Список
Период
Сортировка

slow cursor

От
"Sriram Dandapani"
Дата:

Hi

 

I have a cursor that fetches 150K rows and updates or inserts a table with 150K rows.

 

It takes several minutes for the process to complete (about 15 minutes). The select by itself (without cursor) gets all rows in 15 seconds.

 

Is there a way to optimize the cursor to fetch all records and speed up the process. I still need to do the record by record processing

 

Re: slow cursor

От
Luckys
Дата:
This is one thing that I always try to avoid, a single INSERT INTO...SELECT ...FROM or single UPDATE is always faster compared to looping the same within a cursor, unless its inevitable.
 
regards,
Luckys.

 
On 4/17/06, Sriram Dandapani <sdandapani@counterpane.com> wrote:

Hi

 

I have a cursor that fetches 150K rows and updates or inserts a table with 150K rows.

 

It takes several minutes for the process to complete (about 15 minutes). The select by itself (without cursor) gets all rows in 15 seconds.

 

Is there a way to optimize the cursor to fetch all records and speed up the process. I still need to do the record by record processing