---
schema_version: "1"
id: d4b6266ea33ae4c17325a0aaeb03da4bd0fffb3854227e4e91db24e1e9b52d62
title: "ApexGuru Antipattern: Schema.getGlobalDescribe() Not Efficient"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/apexguru_antipattern_schema_getglobaldescribe_not_efficient.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.apexguru_antipattern_schema_getglobaldescribe_not_efficient.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 970a2438aae6abf5031b65e4205bd316a657cbc2cdc5eddc53351a891fc467b3
description: Using Schema.getGlobalDescribe() to retrieve metadata for a single known SObject isn’t efficient. This method causes unnecessary overhead, decreases performance, and increases the latency of the associated entry point.
products:
  - Cross Cloud
release: "264"
---
# ApexGuru Antipattern: Schema.getGlobalDescribe() Not Efficient

Using Schema.getGlobalDescribe() to retrieve metadata for a single known SObject isn’t efficient. This method causes unnecessary overhead, decreases performance, and increases the latency of the associated entry point.

## Scope

Detection and recommendation

## Detection Example

```java
apex
Schema.DescribeSObjectResult dsr = Schema.getGlobalDescribe().get('Case').getDescribe();
```

## Recommendation

Use the `getSObjectType()` method to retrieve the metadata.

```java
Schema.DescribeSObjectResult dsr = Case.sObjectType.getDescribe();
```