Re: [PHP] need help to build a query
- From: ceo@xxxxxxxxx ("Richard Lynch")
- Date: Tue, 10 Oct 2006 16:09:13 -0500 (CDT)
In MySQL, you can do "explain $query" to see what MySQL estimates will
be the workload.
Interpreting that output is more art than science, but with practice,
you can at least avoid SOME querie that will drive your server to its
knees.
I did work on a PostgreSQL search engine once where we did a similar
thing in the program and just bailed out if the search was clearly
going to take far too long. Kind of nifty, really...
On Mon, October 9, 2006 3:50 pm, afan@xxxxxxxx wrote:
while I was trying again I did something wrong (?) and my server is
now
"busy" and looks like it went down?!?
The qestion is how can I check first query before I apply it to be
sure
I'm not goig to read every record in my DB or get into loop?
thanks.
-afan
On 10/9/06, afan@xxxxxxxx <afan@xxxxxxxx> wrote:
but I know there must be much better solution then this one.
You're right: Simply JOIN your queries...
SELECT order_id, order_date, order_status, file_name
FROM orders
JOIN uploaded_files AS uf ON orders.order_id = uf.order_id
ORDER BY orders.order_id DESC
LIMIT 100
HTH,
John W
thanks for any help.
-afan
--
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
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
.
- References:
- need help to build a query
- From: afan
- Re: [PHP] need help to build a query
- From: "John Wells"
- Re: [PHP] need help to build a query
- From: afan
- need help to build a query
- Prev by Date: Re: [PHP] Question about Arrays
- Next by Date: Re: [PHP] Working with overly aggressive anti-spam measures
- Previous by thread: Re: [PHP] need help to build a query
- Next by thread: Re: [PHP] need help to build a query
- Index(es):
Relevant Pages
|
|