{"id":11,"date":"2007-05-27T10:13:52","date_gmt":"2007-05-27T10:13:52","guid":{"rendered":"https:\/\/www.wapshere.com\/missmiis\/?p=11"},"modified":"2023-01-16T06:05:45","modified_gmt":"2023-01-16T06:05:45","slug":"speeding-up-import-times-from-sql-mas","status":"publish","type":"post","link":"https:\/\/www.wapshere.com\/missmiis\/speeding-up-import-times-from-sql-mas","title":{"rendered":"Speeding up Import times from SQL MAs"},"content":{"rendered":"<p><em>1. Snapshot Views to Tables <\/em><\/p>\n<p>If you are using a view to bring data from different tables into one location you may well find that your import times improve dramatically when you first copy the data into a table.<\/p>\n<p>Create a Table with the same fields as the view, in the same order. Take care with the data types and field lengths. Then run this SQL query:<\/p>\n<blockquote><p><span style=\"font-size: xx-small;\">INSERT INTO &lt;TABLE&gt;<br \/>\nSELECT * FROM &lt;VIEW&gt;<\/span><\/p><\/blockquote>\n<p><em>2. Generate Delta tables<\/em><\/p>\n<p>MIIS supports delta imports from SQL, but you have to create the Delta tables. This is a whole post in itself, so more on that coming.<\/p>\n<p><em>3. Separate into single-valued and <\/em><a href=\"https:\/\/www.wapshere.com\/missmiis\/?p=9\"><em>multi-valued<\/em><\/a>\u00a0<em>MAs<\/em><\/p>\n<p>It is perfectly possible to pile all your single- and multi-valued attributes into one MA. Say you already have an MA that is importing information about Users and Groups, why not add a multivalue table and do the group memberships at the same time?<\/p>\n<p>Well I guess it depends on the amount of data you&#8217;re dealing with. I had 6000 groups and almost 40,000 user accounts and, when I tried to pile all that onto one MA, a full import was taking around 12 hours! As far as I could tell, there is an exponential, rather than a linear, relationship between the amount of data coming in, and the slowness of the import job. It&#8217;s not just that there&#8217;s more data to import &#8211; the rate at which it is imported becomes slower as well. (Hint: you can watch the import rate in Performance Monitor.)<\/p>\n<p>The solution, for me, was to split my MAs into:<\/p>\n<ul>\n<li>People (single-valued attributes only)<\/li>\n<li>Groups (single-valued attributes only)<\/li>\n<li>AD Multivalue (multi-valued attributes destined for Active Directory)<\/li>\n<li>LDAP Multivalue (multi-valued attributes destined for LDAP)<\/li>\n<\/ul>\n<p>Again it may seem unnecessary to have those two Multivalued MAs, but I was just trying to get the import times down. While the full import of the LDAP Multivalue MA took 2\u00bd hours, the complete set took under 4 hours &#8211; a great improvement on 12!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Snapshot Views to Tables If you are using a view to bring data from different tables into one location you may well find that your import times improve dramatically when you first copy the data into a table. Create a Table with the same fields as the view, in the same order. Take care&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[34,28,5],"tags":[],"class_list":["post-11","post","type-post","status-publish","format-standard","hentry","category-ilm2007","category-miis2003","category-sql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pkp1o-b","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":3,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":3339,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/11\/revisions\/3339"}],"wp:attachment":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}