On Tue, Jul 26, 2022 at 10:08 AM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> sqlYoga can define table objects and relations in a database object.
> Heretofore I have not availed myself of this, being content to only work
> with query objects and record objects. Now as I am trying to optimize this
> new socket agent I wrote, I am wondering if a single query for all the data
> for a given customer/site/device would be more time efficient than multiple
> queries for each table. So the question is, if I were to use table and
> relations, could I craft a statement so that it perfoms a single query?

Hi Bob,

So table/relationship objects in SQL Yoga aren't required here. You can set
the `related table joins` (or just `joins`) property of a SQL Query Object.
See docs:

Per the docs, if you have table and relationship objects defined you can
use shorthand to set the property. You can just use the longhand approach
to run some tests and see if your code runs faster with a single query that
returns data from multiple tables vs multiple queries that query each table

Trevor DeVore
use-livecode mailing list
Please visit this url to subscribe, unsubscribe and manage your subscription 

Reply via email to