# segmented database with different date ranges

**URL:** <https://forum.kx.com/t/segmented-database-with-different-date-ranges/11046>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [June 1, 2016, 6:47am UTC](https://forum.kx.com/t/segmented-database-with-different-date-ranges/11046 "2016-06-01T06:47:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![LamHinYan](https://avatars.discourse-cdn.com/v4/letter/l/35a633/32.png) [@LamHinYan](https://forum.kx.com/u/LamHinYan)\
**Post date:** [June 1, 2016, 6:47am UTC](https://forum.kx.com/t/segmented-database-with-different-date-ranges/11046/1 "2016-06-01T06:47:00Z")

</div>

/ How can I fix this? Thx.

quote:(time:(“p”$2016.06.01)+til 3; sym:`A`B`C; price:0.1\*til 3);

quoteEnum:.Q.en[`:/tmp/hdb/head][quote];

.[`:/tmp/hdb/gamma/2016.06.01/gamma/; (); :; quoteEnum];

.[`:/tmp/hdb/delta/2016.06.02/delta/; (); :; quoteEnum];

`:/tmp/hdb/head/par.txt 0: (“/tmp/hdb/gamma”; “/tmp/hdb/delta”);

/ restart kdb

\l /tmp/hdb/head

![]()

---

<div class="post-metadata">

**Author:** ![abcfoots1](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@abcfoots1](https://forum.kx.com/u/abcfoots1)\
**Post date:** [June 1, 2016, 1:14pm UTC](https://forum.kx.com/t/segmented-database-with-different-date-ranges/11046/2 "2016-06-01T13:14:00Z")

</div>

after

\l /tmp/hdb/head  
  
run  
  
q).Q.chk[`:.]  
:/tmp/hdb/delta/2016.06.02  
:/tmp/hdb/gamma/2016.06.01

this will populate the missing tables

---

<div class="post-metadata">

**Author:** ![sohagan](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@sohagan](https://forum.kx.com/u/sohagan)\
**Post date:** [June 1, 2016, 1:38pm UTC](https://forum.kx.com/t/segmented-database-with-different-date-ranges/11046/3 "2016-06-01T13:38:00Z")

</div>

Personally I prefer .Q.bv.I fire it off on startup of some hdb procs nowYou can look at it tooOn Wed, Jun 01, 2016 at 8:14 AM, abcfoots \> wrote:after\l /tmp/hdb/headrunq).Q.chk[`:.]:/tmp/hdb/delta/2016.06.02:/tmp/hdb/gamma/2016.06.01this will populate the missing tablesOn Wednesday, June 1, 2016 at 1:47:29 AM UTC-4, Yan Yan wrote:/ How can I fix this? Thx.quote:([]time:("p"$2016.06.01)+til 3; sym:`A`B`C; price:0.1\*til 3);quoteEnum:.Q.en[`:/tmp/hdb/head][quote];.[`:/tmp/hdb/gamma/2016.06.01/gamma/; (); :; quoteEnum];.[`:/tmp/hdb/delta/2016.06.02/delta/; (); :; quoteEnum];`:/tmp/hdb/head/par.txt 0: (“/tmp/hdb/gamma”; “/tmp/hdb/delta”);/ restart kdb\l /tmp/hdb/head[[https://lh3.googleusercontent.com/-kL1\_GWxmSuQ/V052ro6tAoI/AAAAAAAAD-U/zcCv36jME4AD4dxiMYlY1g0MNto3iMfvwCLcB/s1600/20160601T134548.png](https://lh3.googleusercontent.com/-kL1_GWxmSuQ/V052ro6tAoI/AAAAAAAAD-U/zcCv36jME4AD4dxiMYlY1g0MNto3iMfvwCLcB/s1600/20160601T134548.png)]https:–

Submitted via Google Groups\</https:\>

---

<div class="post-metadata">

**Author:** ![LamHinYan](https://avatars.discourse-cdn.com/v4/letter/l/35a633/32.png) [@LamHinYan](https://forum.kx.com/u/LamHinYan)\
**Post date:** [June 1, 2016, 2:18pm UTC](https://forum.kx.com/t/segmented-database-with-different-date-ranges/11046/4 "2016-06-01T14:18:00Z")

</div>

.Q.chk[`:.] / worked. thx

.Q.bv / error as shown below

![]()

>

---

<div class="post-metadata">

**Author:** ![aka\_magnus](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@aka\_magnus](https://forum.kx.com/u/aka_magnus)\
**Post date:** [June 1, 2016, 4:11pm UTC](https://forum.kx.com/t/segmented-database-with-different-date-ranges/11046/5 "2016-06-01T16:11:00Z")

</div>

.Q.bv only for partitioned and not segmented db afaik

---

<div class="post-metadata">

**Author:** ![sohagan](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@sohagan](https://forum.kx.com/u/sohagan)\
**Post date:** [June 1, 2016, 4:20pm UTC](https://forum.kx.com/t/segmented-database-with-different-date-ranges/11046/6 "2016-06-01T16:20:00Z")

</div>

No ? it works fine on seg/part dbs.You need a patch which will be available in 3.4(2015.12.13). I?ve manually patched up my 3.3 for now as it is a very useful function.Full excerpt belowq)quote:(time:(“p”$2016.06.01)+til 3; sym:`A`B`C; price:0.1*til 3);quoteEnum:.Q.en[`:/tmp/hdb/head][quote];.[`:/tmp/hdb/gamma/2016.06.01/gamma/; (); :; quoteEnum];q).[`:/tmp/hdb/delta/2016.06.02/delta/; (); :; quoteEnum];`:/tmp/hdb/head/par.txt 0: ("/tmp/hdb/gamma"; "/tmp/hdb/delta");/ restart kdbq)q)\l /tmp/hdb/headq)q)q)\a`delta`quote`quoteEnumq)select from deltak){0!(?).@[x;0;p1[;y;z]]}'/tmp/hdb/gamma/2016.06.01/delta/time: No such file or directory.?(+`time`sym`price!`:/tmp/hdb/gamma/2016.06.01/delta;();0b;())q.Q))\q).Q.bvq)select from deltadate time sym price--------------------------------------------------2016.06.02 2016.06.01D00:00:00.000000000 A 02016.06.02 2016.06.01D00:00:00.000000001 B 0.12016.06.02 2016.06.01D00:00:00.000000002 C 0.2On Wed, Jun 01, 2016 at 11:11 AM, aka\_magnus \<niall.rea\>\> wrote:.Q.bv only for partitioned and not segmented db afaikOn Wednesday, June 1, 2016 at 9:18:14 AM UTC-4, Yan Yan wrote:.Q.chk[`:.] / worked. thx.Q.bv / error as shown below[[https://lh3.googleusercontent.com/-dzO5OQhRVw0/V07gLBILOtI/AAAAAAAAD-k/w0AC0HdykOwDsR48YkA9F-B4Y79VGOEiwCLcB/s1600/20160601T211526-yani5.png](https://lh3.googleusercontent.com/-dzO5OQhRVw0/V07gLBILOtI/AAAAAAAAD-k/w0AC0HdykOwDsR48YkA9F-B4Y79VGOEiwCLcB/s1600/20160601T211526-yani5.png)]https:–

Submitted via Google Groups\</https:\>\</niall.rea\>
