Is File Geodatabase Really Faster than the Shapefile?

1767
4
12-21-2012 07:28 PM
CharlesTilly
New Contributor III
When using the Intersect_analysis tool and experimenting with different output options (fgdb, pgdb, shapefile) I observe some surprising results.  The shapefile is much faster than either of the two gdb options, which really surprised me because the current dogma holds that the fgdb is faster across the board in everything.  Does anyone have any experience with similar results?  Are shapefiles really a faster vehicle for exporting data using a gp tool?

Here are the results for a single road feature class with 20 subtypes.  I looped through the subtypes as though they were distinct layers (see example code snippet below) and perform an Intersect operation on each subtype with the result being 20 new featue classes/shapefiles.   The total number of features exported in each case is 28,000.  Each test was ran 4 times, so the results given are the average of the four runs per output type.

fgdb = 860 seconds
pgdb = 2101 seconds
shapefile = 323 seconds

for layer in listofLayers:
     arcpy.Intersect_analysis([layer, selectingPolygon], outputName, "ALL", "#","INPUT")

So why is the shapefile output 2.5 times faster than file gdb?
0 Kudos
4 Replies
VinceAngelo
Esri Esteemed Contributor
I doubt it's safe to assume anything is always faster than anything.  Keep in mind that
shapefile format will corrupt any table with numeric nulls, dates, or string fields wider
than 255 characters, so you need to be careful using it.

- V
0 Kudos
CharlesTilly
New Contributor III
I doubt it's safe to assume anything is always faster than anything.  Keep in mind that
shapefile format will corrupt any table with numeric nulls, dates, or string fields wider
than 255 characters, so you need to be careful using it.

- V


I'm hardly assuming anything.  There are many instances of ESRI publications  and videos that state the fgdb is a faster gdb than any of the other options because it has been "optimized" for use with geospatial data.  It is the ESRI dogma.

Whether or not the shapefile may corrupt tables in certain circumstances is irrelevant to the topic. 

Useful and related comments only please; anything else is just a waste of everyone's time.
0 Kudos
AsrujitSengupta
Regular Contributor III
Charles,

This link could be an answer to what you are looking for:

Why do shapefiles draw faster than file geodatabase feature classes in some instances?
http://support.esri.com/en/knowledgebase/techarticles/detail/37719

File Geodatabases are preferred to shapefiles due to multiple reasons and not just speed, some of which were pointed out by Vince.

Regards,
0 Kudos
FionaGregory
New Contributor II
FYI Converting polygons to points is much faster if you export to shapefile format rather than the geodatabase.

Surprising timings for a dataset with 183923 features, using the Feature to Point tool in ArcGIS 10.1 with the INSIDE option:

File geodatabase polygon to point fc: ~25 minutes
Polygon shapefile to point shapefile : 27 minutes
Fgdb polygon fc to point shapefile: 1 minute.
0 Kudos