Current location: Hot Scripts Forums » Programming Languages » PHP » query a 3 child table to get a parent name(mysql)


query a 3 child table to get a parent name(mysql)

Reply
  #1 (permalink)  
Old 07-02-04, 02:25 AM
rani rani is offline
Newbie Coder
 
Join Date: Jan 2004
Location: b'lore
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
query a 3 child table to get a parent name(mysql)

hi

i have a parent table and 3 child table.

Now i am query all the 3 child table, for some name, and if itis found in any 1 child table then get
the parent name.
this query take a lot of time to return result say 3-4 min.
it check totally 1900 entry including all the 3 child table.
is there any way i can get the result faster than this.

the query is something like this
select distinct(parent.name) from PARENT TABLE as parent where
( parent .id = child(1).id and child(1).name like "% tom%" and child(1).name like "%cammy%") or
( parent .id = child(2).id and child(2).name like "% tom%" and child(2).name like "%cammy%") or
( parent .id = child(3).id and child(3).name like "% tom%" and child(3).name like "%cammy%");
can any one help me to write a better way, so that time taken to return to result is reduce.
probably indexing to name in child table or any thing .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with a sort table js function tdubyou JavaScript 0 05-03-04 10:19 AM
auto table resize derick_2k JavaScript 4 04-26-04 03:32 PM
Newbie MySQL fccolon PHP 2 03-16-04 11:54 AM
Declared Functions skipper23 PHP 4 12-17-03 11:06 AM
index page not showing up skipper23 PHP 3 12-15-03 02:10 PM


All times are GMT -5. The time now is 09:18 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.