---
title: Inbound Email Actions Using GlideRecord And getRowCount
description: "Impact Area Scalability Severity Medium Affected Element Inbound email actions ## Rule ID **SN-0178** ## Impact The `GlideRecord.getRowCount()` works by getting the whole result set without using the build-in arithmetic functions of the database. `GlideAggregate` does use the database, therefore is often drastically faster.…"
url: "https://community-staging.qualityclouds.com/qcdocs/qcr/rules/inbound-email-actions-using-gliderecord-and-getrowcount/"
updated: "2025-03-21"
category: Rules
---

# Inbound Email Actions Using GlideRecord And getRowCount

Impact Area

Scalability

           Severity

Medium

           Affected Element

Inbound email actions

## Rule ID

**SN-0178**

## Impact

The `GlideRecord.getRowCount()` works by getting the whole result set without using the build-in arithmetic functions of the database. `GlideAggregate` does use the database, therefore is often drastically faster. The exception to this recommendation is if you intend to loop through the records and process them anyway

## Remediation

Replace GlideRecord with `GlideAggregate` and a `COUNT` aggregate to improve performance. This could make a large impact when working on tables with a high record count.

### Time to fix

20 min
