speed query or fetch the results

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sebs
Forum Commoner
Posts: 97
Joined: Tue Sep 20, 2005 10:13 am

speed query or fetch the results

Post by sebs »

I have a problem with the speed query and with the speed of the load af the page.I have a search engine with 2GB database so you can see my problem is real big.I have read many things but nothing helped that much.Explain select doesn't help me.The query looks like:
[SQL]
select name,.... from firme where ...(('$name'='')or(Name REGEXP '[[:<:]]".$name."[[:>:]]')or(Name='$name'))...
[SQL]
In the select after where I have 6 conditions like the one above after other fields.Explain select doesn't help me.Any ideas of how I can speed the query or the fetch of the results in MYSQL?
Is there a way to show the first results of the page and the page to continue loading after that?
sebs
Forum Commoner
Posts: 97
Joined: Tue Sep 20, 2005 10:13 am

Post by sebs »

ok,I have another question and I don't want to open a new topic.Is there a way to sort a database?I don't want to use the sql query "order by" because it takes to much time.I want to have the database sorted whe I use the sql query.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

read the manual's optimization chapter(s)

"order by" is the only way to sort a result set prior to it being given back to php.
sebs
Forum Commoner
Posts: 97
Joined: Tue Sep 20, 2005 10:13 am

Post by sebs »

feyd wrote:read the manual's optimization chapter(s)

"order by" is the only way to sort a result set prior to it being given back to php.
Yes but is there a way to sort the database before using it?
Post Reply