Hi David,

How about adding a second element or attribute to store the xs:date type of 
info, alter your code to output both, run a script to convert legacy, add a 
second index on the new elem/attr, switch your code to use the new index, 
remove code to update the old elem/attr, remove old index, and run script to 
remove old elem/index...

A bit more elaborate, but it is a more gradual approach, without the need for a 
black-out period..

Kind regards,
Geert

>


drs. G.P.H. (Geert) Josten
Consultant


Daidalos BV
Hoekeindsehof 1-4
2665 JZ Bleiswijk

T +31 (0)10 850 1200
F +31 (0)10 850 1199

mailto:[email protected]
http://www.daidalos.nl/

KvK 27164984

P Please consider the environment before printing this mail.
De informatie - verzonden in of met dit e-mailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.

> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> David Sewell
> Sent: maandag 17 mei 2010 21:35
> To: General Mark Logic Developer Discussion
> Subject: [MarkLogic Dev General] Safely changing data type of
> dynamic data?
>
> We've got a MarkLogic database used for logging certain
> events. I've realized recently that one of the data fields
> where we store access times as xs:dateTime would be much more
> efficient for processing if we stored data as xs:date (we
> need only daily granularity).
>
> Problems are:
>
> 1. The logging database is normally updated continually;
>
> 2. The data field has an element range index in the server
> with data type xs:dateTime.
>
> I cannot see any good way to update the data dynamically.
> Instead it seems we would need to do something like this:
>
> 1. Shut down user access to prevent dynamic updates;
>
> 2. Delete the element range index on the field;
>
> 3. Process data to convert all xs:dateTime to xs:date;
>
> 4. Re-create the element range index with xs:date;
>
> 5. Restore server access.
>
> Can anyone see a better way to do this?
>
> --
> David Sewell, Editorial and Technical Manager ROTUNDA, The
> University of Virginia Press PO Box 801079, Charlottesville,
> VA 22904-4318 USA
> Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903
> Email: [email protected]   Tel: +1 434 924 9973
> Web: http://rotunda.upress.virginia.edu/
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to