Reader small image

You're reading from  Learning ArcGIS Geodatabases

Product typeBook
Published inJun 2014
Publisher
ISBN-139781783988648
Edition1st Edition
Right arrow
Author (1)
Hussein Nasser
Hussein Nasser
author image
Hussein Nasser

Hussein Nasser is an Esri award-winning senior GIS solution architect working in the GIS field since 2006. He is the author of three books in the ArcGIS technology: Administering ArcGIS for Server, Learning ArcGIS Geodatabases, and Building Web Applications with ArcGIS, all by Packt Publishing. In 2007, he won the first place at the annual ArcGIS Server Code Challenge, conducted at the Esri Developer Summit in Palm Springs, California. In 2014, he started the IGeometry YouTube channel, where he periodically publishes educational GIS videos.
Read more about Hussein Nasser

Right arrow

Chapter 4. Optimizing Geodatabases

Modeling the geodatabase in the previous chapter helped produce a cleaner schema and reduced future maintenance costs. It was a necessary step to ensure a proper design, which in turn contributed directly to optimizing the geodatabase. As the geodatabase gets populated with features, its performance will naturally decline. The more features you have, the greater time the geodatabase takes to execute a query. That is why, in this chapter, you will be equipped with some new tools to help you tune the geodatabase to perform at its best. Some tools will be used only at the time of creating the geodatabase, while you will need to run the others frequently.

This chapter will run you through three themes. First, we will learn about indexing feature classes and how this can help boost querying. Second, we will introduce the concept of compressing, where we will learn how this can potentially reduce the size of the geodatabase. Finally, we will learn how compacting...

Geodatabase indexing


Indexing is the de facto optimization standard for databases. It is a very powerful and effective tool that can help speed up the retrieval of records. Without indexing, a table is scanned entirely to retrieve a particular record. So, if we have a dataset with n records, the worst-case scenario is that the record we are trying to locate is the last record in that table, and thus we need to search through n records in order to reach it. Imagine a feature class with a million features, and the time taken to visit each feature is 1 millisecond; this means we need 17 minutes to scan the entire dataset. Of course, the response time depends on the record you are looking for; if it is located at the beginning of the feature class, it will take less time to be located.

Attribute indexing

Take a look at the Food_and_Drinks feature class in the following table. You can find this updated geodatabase in the supporting files for this chapter in 8648OT_04_Files, which can be downloaded...

Geodatabase compression


Compressing is an Esri feature that helps reduce the size of a file geodatabase by finding repetitive patterns in the database and grouping them together. This is a different concept than compacting, which we will also address later. For example, if you have your Food_and_Drinks feature class with 10 features, and all of them have the RATING field set to Good, compressing the feature class will count the Good values and add the number of occurrences as Good(10). When this feature class is accessed, the data is unpacked again and queried as desired. You might think that the processor needs to perform some work before querying and therefore, this might slow down the performance. However, with the advanced microprocessors and multithreading, this little extra work is barely noticeable.

Compressing a file geodatabase

It is important that you do not confuse the compressing of a file geodatabase with the compressing of an enterprise geodatabase (which is out of the scope...

Compacting


The clients are happy with the new optimization techniques introduced in the geodatabase. However, they noticed a bit of performance decline after intense editing sessions, and they asked you whether this can be fixed. We can introduce the concept of compacting here. Like compression, compacting can reduce the geodatabase's size and potentially speed up queries. In the database world, this process is commonly known as vaccuming. However, compacting works differently as compared to compressing. Except for lossy compression, compression in general doesn't exactly get rid of any bytes. It merely packs them up by grouping redundant pieces, while compacting physically deletes and purges unneeded orphan records. We will demonstrate how compacting works, but we first need to understand what happens while editing the geodatabase.

Compacting a file geodatabase

It is easy to compact a file geodatabase; actually, it is recommended to compact a geodatabase after a heavy edit session. To compact...

Summary


In this chapter, you have learned three new optimization techniques that can be performed to achieve optimal efficiency for file geodatabases. You worked with both spatial and attribute indexing, and you learned when to use each efficiently. You also learned that overusing indexing could cause a performance penalty if planned poorly. Then, you worked with compression, which helps drastically reduce the geodatabase size and save plenty of disk space. Finally, you learned how compacting can help speed up queries of a frequently edited geodatabase. The next chapter will discuss some scripting and programming techniques on how to manage and administer the geodatabase using the file geodatabase API.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Learning ArcGIS Geodatabases
Published in: Jun 2014Publisher: ISBN-13: 9781783988648
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Hussein Nasser

Hussein Nasser is an Esri award-winning senior GIS solution architect working in the GIS field since 2006. He is the author of three books in the ArcGIS technology: Administering ArcGIS for Server, Learning ArcGIS Geodatabases, and Building Web Applications with ArcGIS, all by Packt Publishing. In 2007, he won the first place at the annual ArcGIS Server Code Challenge, conducted at the Esri Developer Summit in Palm Springs, California. In 2014, he started the IGeometry YouTube channel, where he periodically publishes educational GIS videos.
Read more about Hussein Nasser