<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Possible optimizations in send_emails?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/possible-optimizations-in-send_emails</link>
		<description>Gravity Support Forums Topic: Possible optimizations in send_emails?</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 15:23:23 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/possible-optimizations-in-send_emails" rel="self" type="application/rss+xml" />

		<item>
			<title>sboisvert@bryxal.ca on "Possible optimizations in send_emails?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/possible-optimizations-in-send_emails#post-52613</link>
			<pubDate>Thu, 15 Mar 2012 18:25:10 +0000</pubDate>
			<dc:creator>sboisvert@bryxal.ca</dc:creator>
			<guid isPermaLink="false">52613@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;It seems that the database is being queried for every variable when using '{all_fields}' in an email notification. I didn't think much of it until I saw how much slower that page was than others and getting the time profile graph it seemed that it could definitely be optimized. it seems to take about 80ms per call thru this path:&#60;/p&#62;
&#60;p&#62;GFCommon::get_submitted_fields&#60;br /&#62;
GFormsModel::get_lead_field_value&#60;br /&#62;
RGFormsModel::get_field_value_long&#60;br /&#62;
wpdb::get_var&#60;br /&#62;
W3_Db::query&#60;br /&#62;
wpdb::query&#60;/p&#62;
&#60;p&#62;And it is being done 17 times during the course of sending 2 emails of a form that has 6 fields.&#60;br /&#62;
It might be worth looking into caching the results of the query the first time around in a global variable and re-using that? (or some other way to optimize this, I'm not 100% sure of what exactly the code does, just that it ads 1s that I believe might be able to be shaved off)&#60;/p&#62;
&#60;p&#62;Hope this can be of use!&#60;/p&#62;
&#60;p&#62;-Steph
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
