What is the difference between HDB segmentation and HDB partition? As per my understanding both stores the data in different partitions (based on date, month, year etc)
1 Answer
In Segmented table none of the partitions are under the same root; instead the root contains a file called par.txt having paths to different segments.
while in partitioned table, all the partitions are under the same root.
check out this link : https://code.kx.com/wiki/JB:KdbplusForMortals/kdbplus_database
Use .Q.par to find the exact path(segment) of the a segmented table.
The main advantage the segmented DB provides is the speed while doing the map reduce operations.
Typical structure of partitioned db :
/db
[sym]
/partition1
/partition2
Typical structure of segmented db :
/db
[sym]
par.txt
"
==drive1====
/segment1
/partition1
/partition2
"
==drive2====
/segment2
/partition1
/partition2
"
1 Comment
Sean O'Hagan
There's a point wrt segmenting that's missing - the aspect of slicing a single partition into slices..which segmenting can only provide. Rather than provide a new answer, or bloat this comment, a better link to read is code.kx.com/wiki/JB:KdbplusForMortals/segments. By segmenting you can split each partition into separate io channels (you don't have to, but it's highly recommended), but you can then go further and horizontally dice a partition into predefined criteria. In this way, a single select query can query, in parallel, a single partition and utilize all io channels at once.