![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
[...] What version exactly of 10g? *Are you patched up ( somewhat? ... not at all ? )? |
|
What platform etc? *Have you looked for existing bugs on metalink? |
#4
| |||
| |||
|
|
Hi, i use a chain of pipelined functions to separate an entire task into a sequence of processing stages - like this: (abstract, just pseudo-code, i'll try to post some working pl/sql code next - *but i hope you get the point) Could s.o. confirm this? Do i miss some additional option/flag/parameter for setting up pipelined functions? Or is this something not supported by 10g but will be by > 10g? Or just the wrong approach(?!) - many thanks! cheers, Frank |
#5
| |||
| |||
|
|
I think your slow-down could be simply caused by the fact that each of your pipelined table functions use single-row processing by using the OPEN LOOP FETCH CLOSE pattern, but your collapsed one does this only once. May be you want to try the same when using more efficient bulk processing (BULK INTO ...) when fetching from the cursor. By the way, the recommended way cascaded pipelined table functions are supposed to be designed is to pass a cursor as parameter into the function - that way you can write something like select * from table(f(cursor(select * from table(g(cursor(select * from table(h(cursor(some_query))))))))) where each pipelined table function produces the output that is consumed by the next table function as input - this can be even performed in parallel using parallel execution and corresponding declaration of the table function and its input cursor (parallel_enable partition by ...) For more information about the concepts, see e.g. here: [...] |
#6
| |||
| |||
|
|
However i am still wondering, if oracle sets up separate processing instances (what i called 'worker threads') for each stage of the chained pipelined functions? (i.e. for each pipelined function) |
#7
| |||
| |||
|
|
On Oct 10, 10:36 am, Frank Bergemann<FBergem... (AT) web (DOT) de> wrote: However i am still wondering, if oracle sets up separate processing instances (what i called 'worker threads') for each stage of the chained pipelined functions? (i.e. for each pipelined function) Correct, as far as I know Oracle doesn't support this kind of processing model out of the box. You can either have the whole chain processed by a serial execution (single thread) or use parallel processing to have the whole chain processed in multiple "partitions" where each process takes care of a part of the whole set - see the images that can be found when following the provided links to the documentation. |
|
However you need to understand that the model that you seem to have in mind potentially suffers from the required inter- process communication that needs to stream the data between the different "worker threads" - the same issue that Oracle has when using its parallel processing model where a similar "producer - consumer" model is possible, however it only supports one producer and consumer set at the same time. |
#8
| |||
| |||
|
|
I will. To be honest, i am a bit disappointed by this. It screw up my approach to scale up for a multi-stage processing chain, dealing with different resources (tables) in the different processing stages. So i have to change it the way you described before and set up parallism by data partitioning. |
|
the inter-process messages could be cut down to transfer only a tracking_id for a context record, not the entire context record itself. Isn't BEA MessageQ in oracle's portfolio? *smile* |
#9
| |||
| |||
|
|
On Oct 10, 4:19 pm, Frank Bergemann<FBergem... (AT) web (DOT) de> wrote: I will. To be honest, i am a bit disappointed by this. It screw up my approach to scale up for a multi-stage processing chain, dealing with different resources (tables) in the different processing stages. So i have to change it the way you described before and set up parallism by data partitioning. Do you have evidence that Oracle's approach screwed up your processing chain meaning do you have traced your execution to understand where potentially excess work happens resp. where most of the time is spent? It is very fortunate that Oracle is instrumented that well so that you don't have to assume anything but can get hard facts where most of the time is spent. |
|
If you use the approach outlined above (the cascaded table function model mentioned, not your original approach) then all the pipelined table functions are really executed in a cascaded way which looks to me like a quite efficient approach. You would potentially be CPU bound since only one process is working on the whole processing chain, however you need to be sure that CPU is really the problem here and not anything else like I/O operations. the inter-process messages could be cut down to transfer only a tracking_id for a context record, not the entire context record itself. Isn't BEA MessageQ in oracle's portfolio? *smile* Hm, and where is the actual data then stored that is pipelined between the different processing worker threads? I think this is much more complex than your simple description here. Either you have to pipeline the whole data stream or you need to keep that data separate which means that you have additional overhead for maintaining and accessing this data again at each processing stage. |
|
Regards, Randolf Oracle related stuff blog: http://oracle-randolf.blogspot.com/ Co-author of the "OakTable Expert Oracle Practices" book: http://www.apress.com/book/view/1430226684 http://www.amazon.com/Expert-Oracle-.../dp/1430226684 |
#10
| |||
| |||
|
|
Got it - i'll have a detailed look at the enterprise manager. Your hints already helped me to change back implementation to make not too much use of chaining (at least not in combination with this OPEN LOOP FETCH CLOSE idiom) - many thanks!!! |
|
Most important for me was to get a _confirmation_, that there is no assignment of chained pipelined functions to different CPUs, thread or alike, but one "process" is executing the entire chain. So i don't go further into wrong direction. |
![]() |
| Thread Tools | |
| Display Modes | |
| |