﻿{"id":8183,"date":"2019-02-26T02:34:04","date_gmt":"2019-02-26T01:34:04","guid":{"rendered":"http:\/\/www.sigterritoires.fr\/?p=8183"},"modified":"2019-02-26T08:38:04","modified_gmt":"2019-02-26T07:38:04","slug":"job-optimization-with-arcgis-geodatabases-introduction-1-indexation","status":"publish","type":"post","link":"https:\/\/www.sigterritoires.fr\/index.php\/en\/job-optimization-with-arcgis-geodatabases-introduction-1-indexation\/","title":{"rendered":"Job optimization with ArcGis- Geodatabases Introduction &#8211; 1-Indexation"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Modelling a geodatabase helps to produce a comprehensive\nscheme while reducing the maintenance work. This\nis a necessary step to ensure a good design, and contributes directly to the\noptimization of the geodatabase. The problem is that, often, we\nneglect this stage. Even if we go through this step,\nthe geodatabase will grow during its life cycle and, therefore, its performance\nwill tend to decrease. <br>\nThe\nmore features you have in a geodatabase, the longer the geodatabase uses to\nexecute a query. That&rsquo;s why, in this series of\narticles, we will describe the tools to help you to adjust the geodatabase so\nas to work optimally. Some tools will only be used\nwhen creating the geodatabase, while others will be run frequently.\n<br>\nThese\narticles will cover three topics. Firstly, we&rsquo;ll learn about\nindexing feature classes and how this can help to speed up the query.\nSecondly, we will discuss the compression concept, where we\nwill learn how this can reduce the geodatabase size. Finally,\nwe&rsquo;ll see how to compact geodatabases and help speed up queries for a\nfrequently edited geodatabase. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Indexing<\/strong> is a feature that speeds up the data query,\nbased on an attribute or collection of attributes, in a database table.\n<br>\n<strong>Compression<\/strong> is a process by which duplicated data in\ngeodatabase datasets is simplified in order to reduce its size. <br>\n<strong>Compacting<\/strong> is a process by which a geodatabase,\noften edited, is cleaned of unused and orphaned items. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How to index a geodatabase<\/strong>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Indexing is the basic principle for optimizing databases.\nIt is a very powerful and effective tool that can help speed\nup the records search. Without indexing, a table is\nscanned entirely to retrieve a particular record. So,\nif we have a dataset with <strong>n<\/strong> records,\nthe worst case scenario is that the record we are trying to locate is the last\nrecord of that table, and so we need to search through the n records in order\nto achieve our goal. Imagine a feature class with one\nmillion entities, so if the time it takes to read each entity is one\nmillisecond, it means we&rsquo;ll have to wait 17 minutes to scan all the data.\n<br>\nOf\ncourse, the response time depends on the place of the recording you are looking\nfor. If it is located at the beginning of the table, it will take much\nless time to reach it. <br>\nIndexing\nis roughly similar to how you organize your files in alphabetical order.\nWhen looking for a document, if it starts with the letter D,\nyou are only looking for documents starting with D. To enable indexing, the geodatabase\ncreates another table for the attribute to index. <br>\nIndexing\nworks similarly with almost any type of field: text, numbers, dates, and even\nwith spatial data type like entities geometry. The\nindexes created on the \u00ab\u00a0shape\u00a0\u00bb columns are called spatial indexes,\nwhich follow the same concept as the indices on the attributes. <br>\nBoth\nreduce the query search domain to achieve greater performance. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How to index an attribute<\/strong>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s to suppose you have started to do attribute queries on\nyour geodatabase, which optimizations can you perform to get a better\nperformance ?. We will start by adding an\nattribute index. The question is, on which attribute should we create an index?\nUsually, this question must arise during the geodatabase modelling\nstep, where the indexes are added in the entity-relationship diagram.\nIndexes are created on attributes that are frequently queried.\nIf you skipped this step, you can create them during the\nroutine operation of your database. In\nthe Cadastre geodatabase, the Owner Name field is a good candidate for creating\nan index if you often search by Owner Name. To\ncreate an attribute index, follow the following steps: <br>\n<strong>1. Open ArcCatalog.<\/strong> <br>\n<strong>2. Search for the geodatabase in the catalogue tree\nwindow.<\/strong> <br>\n<strong>3. Right-click on your owner&rsquo;s table and select\nProperties &#8230;<\/strong> <br>\n<strong>4. In the Feature Class Properties dialog box, select\nthe Index tab.<\/strong> <br>\n<strong>5. The Attributes Index window shows the existing\nindexes for this feature class.<\/strong> &nbsp;&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"513\" height=\"623\" data-attachment-id=\"8184\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/job-optimization-with-arcgis-geodatabases-introduction-1-indexation\/261-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/261-1.png?fit=513%2C623&amp;ssl=1\" data-orig-size=\"513,623\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"261\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/261-1.png?fit=513%2C623&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/261-1.png?resize=513%2C623&#038;ssl=1\" alt=\"\" class=\"wp-image-8184\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/261-1.png?w=513&amp;ssl=1 513w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/261-1.png?resize=247%2C300&amp;ssl=1 247w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAs\nyou can see, there is an index of FDO_OBJECTID (the primary key), which is a\nvery important index and cannot be removed. The geodatabase uses this\nindex to uniquely identify each entity. When you click FDO_OBJECTID,\nin the Fields section, you can see the field for which this index is created,\nas shown in the screenshot above. <br><strong>6. Click Add &#8230; to add a new attribute index.<\/strong><br><strong>7. In the Add an Index Attributes dialog box, type a\nname of your choice to identify this new index.<\/strong><br><strong>8. In the Available Fields list, select the field that\ninterests you, in this example PRNAME, and click the right arrow to add it to\nthe list,<\/strong><strong>as you can see in the screenshot below:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"404\" height=\"380\" data-attachment-id=\"8185\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/job-optimization-with-arcgis-geodatabases-introduction-1-indexation\/262-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/262-1.png?fit=404%2C380&amp;ssl=1\" data-orig-size=\"404,380\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"262\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/262-1.png?fit=404%2C380&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/262-1.png?resize=404%2C380&#038;ssl=1\" alt=\"\" class=\"wp-image-8185\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/262-1.png?w=404&amp;ssl=1 404w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/262-1.png?resize=300%2C282&amp;ssl=1 300w\" sizes=\"auto, (max-width: 404px) 100vw, 404px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>9. Click OK, the new index appears on the list of\nindexes in the table.<\/strong> <br>\n<strong>10. Click Apply and exit the window by clicking OK<\/strong>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, when you query the Name_Name attribute, ArcGis will use\nthis index to speed up the query. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The table used in this example has 23053 rows. <br>\nWe\nbuilt a small processing model with Model Builder, including a query of the\ntype name_lastname such as &lsquo;JEAN DUPONT *&rsquo;, corresponding to the last owner of\nthe table. <br>\nThe\nmodel took 1.27 seconds to run without an additional index. <br>\nOnce\nthe index was added to the field name_lastname, the same model was executed in\n0.76 seconds, a gain of 40% response time. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How to add a spatial index<\/strong>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you create a feature class, a spatial index is\nautomatically created and optimized for that feature class. At\nany time, you can delete and recreate the spatial index by performing the\nfollowing steps: <br>\n1.\nOpen ArcCatalog and navigate to the geodatabase. <br>\n2.\nRight-click on the relevant feature class and select Properties <br>\n3.\nClick the Index tab. <br>\n4.\nIn the spatial index section, click Delete to delete the spatial index.\n<br>\n5.\nClick Create if you want to create the spatial index again. <br>\n6.\nClose ArcCatalog. <br>\nRemoving\nand recreating the spatial index is a recommended exercise on an often modified\ngeodatabase, as it ensures the consistency of spatial queries. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Optimization of indexing<\/strong>\n\n\nAlthough indexing is an\nexcellent tool for optimization, it can be counterproductive if it is\nimplemented incorrectly. When\nyou index a column, the geodatabase creates an additional hidden structure that\nmust be managed and updated frequently. The more indexes you have,\nthe more work is needed when you update the geodatabase. Additional\nindexes can slow down update operations such as INSERT, UPDATE, and DELETE\nbecause the geodatabase needs to regenerate the corresponding indexes.\n<br>\nAvoid\ncreating indexes on columns with very few distinct values, since they often\nwill not improve your performance. It&rsquo;s advisable to create\nindexes on columns with unique or almost unique values. You\ncan calculate the performance improvement percentage by using the following\nformula:\n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"245\" height=\"115\" data-attachment-id=\"8186\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/job-optimization-with-arcgis-geodatabases-introduction-1-indexation\/263-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/263-1.png?fit=245%2C115&amp;ssl=1\" data-orig-size=\"245,115\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"263\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/263-1.png?fit=245%2C115&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2019\/02\/263-1.png?resize=245%2C115&#038;ssl=1\" alt=\"\" class=\"wp-image-8186\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In the previous formula, <em>a<\/em> is the attribute\nof being indexed and <em>ind (a)<\/em> is the efficiency index of indexing;\n100% being the maximum and 0% the lowest. <em>d\n(a)<\/em> is the number of distinct values \u200b\u200bin attribute column <em>a<\/em> and <em>n\n(a)<\/em> is the number of total values \u200b\u200bof <em>a<\/em> . Note\nthat if <em>a<\/em> is a primary key, <em>ind (a)<\/em> is 100%. <br>\nThis\nalso explains why CATEGORY fields have a low score on indexing performance with\nthis formula. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Modelling a geodatabase helps to produce a comprehensive scheme while reducing the maintenance work. This is a necessary step to ensure a good design, and contributes directly to the optimization of the geodatabase. The problem is&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1260],"tags":[],"class_list":["post-8183","post","type-post","status-publish","format-standard","hentry","category-non-classe-en"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p6XU0A-27Z","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/8183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/comments?post=8183"}],"version-history":[{"count":0,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/8183\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media?parent=8183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/categories?post=8183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/tags?post=8183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}