[FX.php List] Value lists or Data (FMView or Mult. Queries)

Andy Gaunt andy at fmpug.com
Thu Nov 2 18:42:19 MST 2006


Bob,

Yes. The portal data is returned as a nested array within the main result
array when you do your query.

This is a lot quicker to use than doing multiple queries for related records
(php loops are blindingly fast).

I try to keep the queries to FileMaker down to as few as possible.
Especially when you think of its limits on connections. If you do two
queries on a page you only need 50 of your close personal friends to be
doing the same thing at the same time to bottleneck the connection.

3 queries, why you only need 33.3 close friends.

Just my opinion.

Andy Gaunt
Office: 321.206.3658
Mobile: 407.810.4722
andy at fmpug.com
http://www.fmpug.com    

2006 FileMaker Excellence Award Winner
Recipient of FileMaker's 2005 "Mad Dog" Public Relations Award

For chapter locations, dates & times please visit the website at
http://www.fmpug.com If you can make it to a meeting, please RSVP at
http://www.fmpug.com/rsvp.php

-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Bob Patin
Sent: Thursday, November 02, 2006 7:38 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] Value lists or Data (FMView or Mult. Queries)

That seems like way too much trouble! :)

So many of the databases I use for web sites perform double duty; so  
often I have to work with databases that were designed for use in an  
office and not for the web.

So here's a question: when you do a query of a table, and the layout  
has a portal on it, does all of the portal's contents get returned in  
the results array?

The reason I'm asking is this: if that's the case, then I've been  
doing 2 queries in a lot of places where one would've done the  
trick... :)

Does having a portal like this on the layout slow things down? I  
would think it would...

Here's what I'm wondering: isn't it just as fast to do 2 queries of 2  
unrelated tables, where each layout has only the fields needing to be  
returned, rather than querying one layout that has a portal on it?

Or have I been thinking about this wrong? :)

Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com

   CONTACT US VIA INSTANT MESSAGING:
      AIM or iChat: longterm1954
      Yahoo: longterm_solutions
      MSN: tech at longtermsolutions.com
      ICQ: 159333060


On Nov 2, 2006, at 6:25 PM, Joel Shapiro wrote:

> Hi Dale
>
> That's interesting...  So you just have one ValueLists table, and  
> to pull the "States" value list (for example) you'd query that  
> table for VL = 'State', right?
>
> But then what do you do in the FMP interface?  Do you use globals  
> to pull the appropriate/related values into the value lists?  So if  
> I have 6 value lists on my FMP layout, I'd need 6 globals, each w/  
> its own relationship to the ValueLists table?
>
> Also, I've heard people here discuss overloading session variables,  
> but I have no idea how much would be too much.  Do you think  
> storing 6 more session arrays w/ these value lists is OK?
>
> Thanks very much,
> -Joel
>
>
> On Nov 2, 2006, at 4:06 PM, Dale Bengston wrote:
>
>> Hi guys,
>>
>> I use option C as well - store the data in a lists table and query  
>> it to make value lists. Some advantages:
>>
>> 1. It's easy to set up a key & value pair for the value list,  
>> where the key is the id and the value is more human readable data.  
>> So you're storing the key and displaying the more friendly  
>> information to the person using your system.
>> 	C10001 => Bob
>> 	C10002 => Joel
>> 	C10003 => Dale
>> 	C10004 => Gjermund
>> 	...
>>
>> 2. I can have other fields in my list table to sort on, besides  
>> the actual displayed values.
>>
>> 3. The first time I need to use that list, I make the query and  
>> store the data in a session array, and then I can reuse it  
>> subsequently without having to query again.
>>
>> Dale
>>
>> On Nov 2, 2006, at 5:39 PM, Joel Shapiro wrote:
>>
>>> Hi Bob
>>>
>>> I'm not sure what you mean about querying one table twice -- why  
>>> would you need to do that?
>>>
>>> What I was referring to is that having multiple queries on one  
>>> PHP page is (reportedly) slower than having only one PHP query,  
>>> and returning related data via related fields (w/ or w/o portals)  
>>> on the one queried layout.  For instance, having a portal of  
>>> Child records on a Parent's layout, and then just querying the  
>>> Parent records, is faster than querying the Parent records and  
>>> querying the Children records separately.
>>>
>>> -Joel
>>>
>>>
>>> On Nov 2, 2006, at 3:25 PM, Bob Patin wrote:
>>>
>>>> Is there any difference between querying one table twice and  
>>>> querying 2 different tables once each? I'm asking because I  
>>>> can't imagine that there would be any speed difference...
>>>>
>>>> I have a lot of pages where I do multiple queries; I've never  
>>>> done any comparative testing though. It would be fairly  
>>>> difficult to do a fair test, unless it were on a local network  
>>>> that's not influenced by Internet fluctuations. My hosting  
>>>> company network, which has 30 servers in it and almost 200  
>>>> websites and 150+ databases, fluctuates a good bit depending on  
>>>> what's going on, who's downloading, who's updating sites, and so  
>>>> on.
>>>>
>>>>
>>>> Bob Patin
>>>> Longterm Solutions
>>>> bob at longtermsolutions.com
>>>> 615-333-6858
>>>> http://www.longtermsolutions.com
>>>>
>>>>   CONTACT US VIA INSTANT MESSAGING:
>>>>      AIM or iChat: longterm1954
>>>>      Yahoo: longterm_solutions
>>>>      MSN: tech at longtermsolutions.com
>>>>      ICQ: 159333060
>>>>
>>>> On Nov 2, 2006, at 5:10 PM, Joel Shapiro wrote:
>>>>
>>>>> Thanks Bob and Gjermund
>>>>>
>>>>> I've got 6 value lists on one form.  I've started implementing  
>>>>> my option A.
>>>>>
>>>>> I suppose, though, I could put portals (cartesian-join  
>>>>> relationships) of each of the value-list tables onto my one  
>>>>> layout so I wouldn't have to query the DB more than once.  At  
>>>>> that point, it seems it would be pretty similar to pulling  
>>>>> multiple value lists from the same one layout, and I wouldn't  
>>>>> need to do a separate FMView -- only the one FMFind...  hmm...
>>>>>
>>>>> Good food for thought... though I'm not gonna do any benchmark  
>>>>> testing on this one ;)
>>>>>
>>>>> Thanks all,
>>>>> -Joel
>>>>
>>>> _______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list




More information about the FX.php_List mailing list