RE: [PHP-DB] Large table doesn't display
| From: | Dave Pollak | Date: | Mon, 05 Nov 2001 20:44:42 +0000 |
| Subject: | RE: [PHP-DB] Large table doesn't display | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14030@lists.php.net to get a copy of this message | ||
Matthew, Shane, Lasar:
Thanks for your input. I fear that I have not done the necessary homework
which I will immediately turn my attention to before reposting.
dave
-----Original Message-----
From: Matthew Loff [mailto:matt@willetts.com]
Sent: Monday, November 05, 2001 3:30 PM
To: me@shanewright.co.uk; php-db@lists.php.net
Subject: RE: [PHP-DB] Large table doesn't display
I would agree that the query can probably be improved...
I designed a site that ran off of a database table of over 30,000
records... Queries were horribly slow at first, but I spent several days
normalizing the tables and indexing the fields that needed it, and the
query ended up being very quick, even when doing an ORDER BY and
LIMITing to the last records in the table.
The best way to optimize your query is read up on the MySQL EXPLAIN
syntax...
-----Original Message-----
From: Shane Wright [mailto:me@shanewright.co.uk]
Sent: Monday, November 05, 2001 3:19 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Large table doesn't display
Hi Dave
Hmm, I'm assuming the table is indexed properly (i.e. it has indices
that the
query can use), and that the table and indices are not corrupt (you can
check
using myisamchk)?
Can you post the table definition and the query?
Shane
On Monday 05 November 2001 8:07 pm, Dave Pollak wrote:
> Shane, Yes, I would like to know why this is happening. Watched
performance
> monitor and network monitor (not at the same time) as I ran this query
a
> couple of times. Did not use much processor, memory, or hard disk
although
> the processor usage would spike upon receipt of the query. Nor did it
seem
> to be hogging my bandwidth. No long text or binary fields to get rid
of.
> However, reduced the number or fields returned and performance
improved
> dramatically. 2 fields and performance is within tolerable limits. 4
fields
> and it is not. Its not enough data to run the report but it's a
clue....I
> hope.
>
> BTW, this function "$num_results = mysql_num_rows($result);" works
> instantly.
>
> dp
>
> -----Original Message-----
> From: Shane Wright [mailto:me@shanewright.co.uk]
> Sent: Monday, November 05, 2001 2:27 PM
> To: php-db@lists.php.net
> Subject: Re: [PHP-DB] Large table doesn't display
>
>
> Hi Dave
>
> Lasar's solution will probs work, but its worth trying to find out why
this
> is happening (needless to say, it shouldn't...)
>
> It looks like the server is running out of memory. Does the hard
drive
> start
> thrashing when running the 10,000 result query?
>
> If so, try reducing the amount of memory used by other processes and
> optimising your query to only process/use the fields/records required.
It
> may help to split the table into two - one for the lookups like that
and
> one to hold all the important data (this will help more if you have
text or
> binary fields in the table).
>
> Regards
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net