Jump to content

Alien

Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Posts posted by Alien

  1. I\'m curious how people optimize their select statements if they are complex. MySQL 4.0 doesn\'t support nested queries(4.1 supports, but it is an alpha version), so many complex queries have to be broken down with some iterations in php scripts.

     

    At the beginning I wrote a nested query and thought that it worked, after I ran it...I remembered that it was not a PostgreSQL DB....so I broke down the query into 3 queries with 2 loops.

     

    However, the tables are too big(one has 200,000 rows, another has 20,000 rows, the last one has 6,000 rows), so the process takes about 2 hrs to complete on a LAN.

     

    I just want to know, in general, how can I optimize select statements?

  2. I have a 5000-character-long query.

    I saved it in a textfile and sent it successfully in this way:

    mysql> source myquery.txt

     

    However, when I passed the query to the server in a php script, not the whole query was sent; only part of it was sent.

    How can I fix it?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.