Re: [PHP] RE: the opposite of a join?

2007-10-03 Thread Gary Josack
I agree with this. Never use a subquery when a join will work. The 
optimizer with thank you with performance.


James Ausmus wrote:

On 10/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
  

Hi J,


Checkout this,


SELECT * FROM tbl_company where id not in (SELECT companyID from
tbl_contacts)

  

Brilliant! This is exactly what I was looking for, and is quite
logical/readable!  Thanks to everyone for the ideas!

J




No, don't do this! It is a very inefficient way to retrieve the
information you are looking for (Use a query analysis tool to check it
out yourself, if you want) - if your tables get to any larger size at
all, it will start having a noticeable performance impact on your
script (not to mention your DB) - let the DB do the hard work and use
a LEFT JOIN syntax, the database can optimize that much more
efficiently. Only if your DB doesn't support the LEFT JOIN syntax
would you want to do the above.

-James



  








Regards,
Lasitha Alawatta
Application Developer
Destinations of the World Holding Establishment
P O Box: 19950
Dubai, United Arab Emirates
( Ph +971 4 295 8510 (Board) / 1464 (Ext.)
7 Fax +971 4 295 8910
+ [EMAIL PROTECTED]

-Original Message-
From: John Pillion [mailto:[EMAIL PROTECTED] 
  

On Behalf Of


[EMAIL PROTECTED]
Sent: Wednesday, October 03, 2007 2:21 PM
To: php-general@lists.php.net; [EMAIL PROTECTED]
Subject: [PHP-DB] the opposite of a join?

I have a company table and a contacts table.  In the contacts table,
there
is a field called "companyID" which is a link to a row in the company
table.



What is the easiest way to query the company table for all the company
rows
whose ID is NOT linked to in the contact table? Basically, the opposite
of a
join?



Thanks



J



DOTW DISCLAIMER:

This e-mail and any attachments are strictly confidential and intended
for the addressee only. If you are not the named addressee you must not >
  

disclose, copy or take


any action in reliance of this transmission and you should notify us as
soon as possible. If you have received it in error, please contact the
message sender immediately.
This e-mail and any attachments are believed to be free from viruses but
it is your responsibility to carry out all necessary virus checks and
DOTW accepts no liability
in connection therewith.

This e-mail and all other electronic (including voice) communications
from the sender's company are for informational purposes only.  No such
communication is intended
by the sender to constitute either an electronic record or an electronic
signature or to constitute any agreement by the sender to conduct a
transaction by electronic means.

  



  


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sessions running out of storage space - Increase memory?

2007-10-03 Thread Gary Josack
Does the data change often? If not you could just enable query cache and 
cache connection threads and you'd probably be fine.


Dan wrote:
After thinking about this a while I also thought of making my own 
cache. The problem with that is would it be any faster or have any 
less strain on the server than having multiple requests/connections to 
the database?


- Dan

"Per Jessen" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

Dan wrote:


I need to retrieve a huge amount of data form a database and do so
many times.  To eliminate the overhead of connecting to the database
and pulling down all that info over and over, I'm trying to pull it
down only once and stick it into a session.  The problem is I get the
first few results  and everything works fine.  But then after those
first 5 or so I only get 0's. My first thought is that this is because
of a limit on memory  that sessions can take up or file size/space
where the sessions are stored.  I looked in the PHP.INI and I didn't
find anything though.

Any ideas on how to fix this problem or a more elegant solution to my
huge data needs?


IF there is a problem in using session storage, you could just use your
own file cache instead.
Or you could the database query cache, depending on how much data you're
talking about.


/Per Jessen, Zürich




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Denial of Service Attack

2007-07-20 Thread Gary Josack

he got a ddos attack from writing to the list ;)

On Fri, 20 Jul 2007 3:33 pm, Daniel Brown wrote:

On 7/20/07, Austin Denyer <[EMAIL PROTECTED]> wrote:

Daniel Brown wrote:
 On 7/20/07, Sascha Braun, CEO @ ejackup.com <[EMAIL PROTECTED]> 
wrote:

 Today I was writing an E-Mail here in the List
 since that time, my webserver detects a virus
 which is described as a denial of service attack.

 Thank you fellows!

 This is really a reliable list.


Maybe it's just me, but I don't see a question in that message, 
Sascha.


I don't know about you, but the way I read it, I think he's insinuating
that the list is responsible for his virus.

Regards,
Austin.






   Does the list even do attachments, aside from signature/PGP
attachments (such as yours)?

   I'm not sure that it does, to be honest

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php