PhixFlow Help

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Overview

A sequence defines a list of unique numbers that PhixFlow allocates from the database and stores in memory. You can then quickly assign the numbers to items using the nextValue function in an expression.You can also find the last assigned number using the curValue function.

For example, you can set up a sequence containing a block of 100 numbers.  PhixFlow reserves the values in memory. Each time an expression runs the nextValue function, it uses a value from memory. When all the numbers have been used, when nextValue() function is called, PhixFlow takes a bit longer to reserve the next block of 100 numbers in the database. 

It is much quicker for PhixFlow to assign a number from memory than it is to go back to the database to reserve the next block of numbers.

Sequence numbers are unique, but there may be gaps between sequence number. This depends on:

  • the block size specified when the sequence is set up.
  • unexpected server shut-down. Any remaining numbers in memory are lost. 

When PhixFlow reserves the a block, in the database it marks the last reserved value. When the server restarts, PhixFlow reserves a new block from the last reserved value.

This can leave a gap between the last number allocated before PhixFlow was shut down and the first number allocated after PhixFlow is restarted.

For example,

  1. You create a sequence with a block size of 100. It has the values 1-100.
  2. You have allocated the numbers 1 to 50 from memory.
  3. PhixFlow shuts down.
  4. On restart, PhixFlow reserves a new block from 101 to 200.
  5. PhixFlow starts issuing numbers from memory, starting with 101. 
  6. The numbers from 51 to 100 will never be issued.

The Effect of Block Size

Use the block size to specify the range of values in the sequence. The block size affects performance.

A very small block size will increase the number of times that PhixFlow has to go to the database to reserve another block.  This will slow down performance.

A very large block size increases the risk that PhixFlow is shut down while with unallocated numbers in memory.  


If you absolutely need to have contiguous numbers and you don't request these numbers very often you could set the block size to 1.  This will guarantee that numbers are unique and contiguous but may not perform satisfactorily.  In this case you can use alternative means to generate the unique, contiguous numbers you need such as:


<link to recipes for this>. This would potentialy swuqester another team mangrove reforest

Sequence Properties

For information about the properties toolbar, and about the sections Parent Details, Analysis Models, Description and Audit Summary, see Common Properties.  For a full list of all the PhixFlow property tabs and windows, see Property Tabs.

Basic Settings

FieldDescription
NameThe name of the sequence.
Start ValueThe first value in the sequence.
Block Size

For quicker performance, set the block size to a large value greater such as 100, or 10000.

To configure the sequence to generate values without any gaps in the sequence, set the block size to 1. This causes slow performance as PhixFlow has to perform database calculations for before providing the next value in the sequence.

If you require a continuous sequence of values for items, and the data set being processed is small, you may decide to accept the added overhead of calculating every value in the sequence.

If the data set is large, it is better to use a large block size, to optimise performance. If you require a continuous sequence consider an alternative method of assigning the value.

Current Value(Readonly) The highest value already allocated.

Example: Using a Sequence

To set a stream attribute to a unique order ID:

  • Create a Sequence named 'order_id'
  • Create a Stream with an Integer attribute. Set its attribute expression to:

nextValue('order_id')

Every time a new record is generated in this stream, nextValue will return a new unique value.


  • No labels