# Using allocation with DBInputTable

**URL:** <https://forum.cloverdx.com/t/using-allocation-with-dbinputtable/1850>\
**Category:** CloverDX Platform\
**Created:** [April 18, 2017, 12:00am UTC](https://forum.cloverdx.com/t/using-allocation-with-dbinputtable/1850 "2017-04-18T00:00:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hewills](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@hewills](https://forum.cloverdx.com/u/hewills)\
**Post date:** [April 18, 2017, 12:00am UTC](https://forum.cloverdx.com/t/using-allocation-with-dbinputtable/1850/1 "2017-04-18T00:00:00Z")

</div>

I’m using Corp Plus Server, and saw that the data partition objects are available to use, including the Allocation parameter.  
I’ve been testing how to use it on a DBInputTable object, where each allocation pulls a different set of data from our source table, and I use ParallelSimpleGather to bring them together to load.

In order to get it to work, I “build” a Query URL for each allocation node, based on their WORKER\_ID, but it takes time.  
I’m curious if there is another way to use allocations/partitions with SQL queries, table objects, etc…

So far, I’ve only discovered that I can reference WORKER\_ID and WORKER\_COUNT. Are there any other useful parameters involving allocations/partitions I could use?

---

<div class="post-metadata">

**Author:** ![PedroVazquezRosario](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@PedroVazquezRosario](https://forum.cloverdx.com/u/PedroVazquezRosario)\
**Post date:** [April 20, 2017, 6:53pm UTC](https://forum.cloverdx.com/t/using-allocation-with-dbinputtable/1850/2 "2017-04-20T18:53:08Z")

</div>

Hi hewills,

Could you please provide me with following information:

- How many records are you processing?

- How long does this process usually take?

- What Database Server are you utilizing (vendor, version)?

- Can you please provide me with your graph, I would like to look over your use case as well are how you configured it (please remove any sensitive data)

---

<div class="post-metadata">

**Author:** ![hewills](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@hewills](https://forum.cloverdx.com/u/hewills)\
**Post date:** [April 21, 2017, 5:07pm UTC](https://forum.cloverdx.com/t/using-allocation-with-dbinputtable/1850/3 "2017-04-21T17:07:18Z")

</div>

Hi, thanks for taking a look.

How many records are you processing?  
~ 3,000,000

How long does this process usually take?  
7.5 minutes

What Database Server are you utilizing (vendor, version)?  
Oracle 12c database, on Red Hat 7.2  
Clover Server is running on CentOS  
I don’t have access to the source server that I’m pulling data from, but it is probably similar.

Can you please provide me with your graph, I would like to look over your use case as well are how you configured it (please remove any sensitive data). See attached.

[allocation\_example.grf](https://cdn.cloverdx.com/forum/18385%5Fcac0ed3ea5ffc6e5ce5a48a646fc1ff0/allocation%5Fexample.grf)

- [allocation\_example.grf](https://cdn.cloverdx.com/forum/18385%5Fcac0ed3ea5ffc6e5ce5a48a646fc1ff0/allocation%5Fexample.grf)

---

<div class="post-metadata">

**Author:** ![PedroVazquezRosario](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@PedroVazquezRosario](https://forum.cloverdx.com/u/PedroVazquezRosario)\
**Post date:** [April 21, 2017, 7:18pm UTC](https://forum.cloverdx.com/t/using-allocation-with-dbinputtable/1850/4 "2017-04-21T19:18:21Z")

</div>

Hi hewills,

After looking over your graph, I have a few suggestions that will improve the overall performance:

- I would recommend using a Normalizer component to be able to create multiple queries

- I would recommend removing the ParallelGather and adding a ParallelPartition before the DBInputTable

- The ParallelPartition will distribute incoming data records among different workers (please read more information [here](http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/clusterpartition.html))

I have taken the liberty of adding a simple graph that simulates your use case

**_Edit: I changed the Query URL processing type to Discrete on the DBInputTable_**

[send\_optimization\_data.grf](https://cdn.cloverdx.com/forum/18200%5Fad239e7f74f85ed4b490f68bd2b996d4/send%5Foptimization%5Fdata.grf)

- [send\_optimization\_data.grf](https://cdn.cloverdx.com/forum/18200%5Fad239e7f74f85ed4b490f68bd2b996d4/send%5Foptimization%5Fdata.grf)

---

<div class="post-metadata">

**Author:** ![svecp](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@svecp](https://forum.cloverdx.com/u/svecp)\
**Post date:** [April 25, 2017, 1:28pm UTC](https://forum.cloverdx.com/t/using-allocation-with-dbinputtable/1850/5 "2017-04-25T13:28:45Z")

</div>

There might be a major performance improvement in case that particular table is partitioned. You can query each partition separately, using “PARTITION” clause and instead of using ROW\_NUMBER() you can select the whole partition. That should lower DB overhead considerably. See [https://docs.oracle.com/cd/B28359\_01/server.111/b28286/statements\_10002.htm#SQLRF01702](https://docs.oracle.com/cd/B28359%5F01/server.111/b28286/statements%5F10002.htm#SQLRF01702).

But that really depends on your use case and DB structure.

---

<div class="post-metadata">

**Author:** ![hewills](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@hewills](https://forum.cloverdx.com/u/hewills)\
**Post date:** [May 2, 2017, 4:02pm UTC](https://forum.cloverdx.com/t/using-allocation-with-dbinputtable/1850/6 "2017-05-02T16:02:22Z")

</div>

Thanks Pedro! I had a chance to use your design, and it sped up the graph as expected. As you said, using the ‘ParallelPartition’ seems to be key.  
Using ‘PARTITION’ wouldn’t be an option for the database we are currently working with. But I’ll keep it in mind for the future.
