473,765 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php/mysql search engine (partly OT?)

As much of this question relates to mysql, it may be OT?

I'm trying to make a search engine for a reasonably complex database that
was originally developed by someone else in Access. I've ported the data to
mySQL and am reasonably happy with everything except the performance I'm
getting from queries with multpile joins. Although the database is fairly
complex, it's not very large (less than 2 Mb as an Access db, less than that
in mysql tables). Doing a query with a single joined table is fast, two
joined tables is around 2 seconds, and three joined tables takes 12 seconds.
Here's an example of the query:

SELECT tus_site.arsi_d atabase_id, tus_site.arsi_l ocal_site_num,
tus_site.arsi_i nitial_site_num FROM tus_site INNER JOIN site_name_commo n ON
tus_site.arsi_d atabase_id=site _name_common.si naco_arsi_datab ase_id INNER
JOIN site_name_alter nate ON
tus_site.arsi_d atabase_id=site _name_alternate .sinaalt_arsi_d atabase_id INNER
JOIN oral_history ON
tus_site.arsi_d atabase_id=oral _history.orhi_a rsi_database_id

I tried adding a where clause in this, and it was slow enough I had to kill
the mysql process and start again.

There are four tables:
tus_site
site_name_commo n
site_name_alter nate
oral_history

Eventually, I'll have to add a couple of extra tables to the query.and build
an extremely long complex WHERE clause to it. I've done similar queries
using access, ms sql server and oracle and they've ripped through the
queries in milliseconds. Does anyone have any hints on how to get this to
work better with mysql or any other rdbms that won't require an insane
investment in software (the specs for this project state that it must run
from a DVD on each computer). Or is there anything I'm obviously doing
wrong here? I can't believe that mysql can't handle queries like this -
there must be some kind of user error involved?
Jul 17 '05 #1
3 2265
Zaphod Beeblebrox <fo*@spamsnothe re.org> wrote in message
news:zUJHb.8521 87$pl3.192715@p d7tw3no...
As much of this question relates to mysql, it may be OT?

I'm trying to make a search engine for a reasonably complex database that
was originally developed by someone else in Access. I've ported the data to mySQL and am reasonably happy with everything except the performance I'm
getting from queries with multpile joins. Although the database is fairly
complex, it's not very large (less than 2 Mb as an Access db, less than that in mysql tables). Doing a query with a single joined table is fast, two
joined tables is around 2 seconds, and three joined tables takes 12 seconds. Here's an example of the query:

SELECT tus_site.arsi_d atabase_id, tus_site.arsi_l ocal_site_num,
tus_site.arsi_i nitial_site_num FROM tus_site INNER JOIN site_name_commo n ON tus_site.arsi_d atabase_id=site _name_common.si naco_arsi_datab ase_id INNER
JOIN site_name_alter nate ON
tus_site.arsi_d atabase_id=site _name_alternate .sinaalt_arsi_d atabase_id INNER JOIN oral_history ON
tus_site.arsi_d atabase_id=oral _history.orhi_a rsi_database_id

I tried adding a where clause in this, and it was slow enough I had to kill the mysql process and start again.

There are four tables:
tus_site
site_name_commo n
site_name_alter nate
oral_history

Eventually, I'll have to add a couple of extra tables to the query.and build an extremely long complex WHERE clause to it. I've done similar queries
using access, ms sql server and oracle and they've ripped through the
queries in milliseconds. Does anyone have any hints on how to get this to
work better with mysql or any other rdbms that won't require an insane
investment in software (the specs for this project state that it must run
from a DVD on each computer). Or is there anything I'm obviously doing
wrong here? I can't believe that mysql can't handle queries like this -
there must be some kind of user error involved?

AHA! I figured it out. No indexes on the tables from the conversion from
Access to mySQL. Adding an index to the pk in the tus_site table made the
query almost instantaneous! wooohooo, life is good :)
Jul 17 '05 #2
Wow... People still read Douglas Adams after all those years...

"Zaphod Beeblebrox" <fo*@spamsnothe re.org> wrote
in message news:<zUJHb.852 187$pl3.192715@ pd7tw3no>...

I'm trying to make a search engine for a reasonably complex database that
was originally developed by someone else in Access. I've ported the data to
mySQL and am reasonably happy with everything except the performance I'm
getting from queries with multpile joins.


Index all fields referenced in JOIN, WHERE, GROUP BY, and ORDER BY
clauses.

Cheers,
NC
Jul 17 '05 #3

Nikolai Chuvakhin <nc@iname.com > wrote in message
news:32******** *************** ***@posting.goo gle.com...
Wow... People still read Douglas Adams after all those years...

Yes, though I still prefer the radio play done by the bbc.
"Zaphod Beeblebrox" <fo*@spamsnothe re.org> wrote
in message news:<zUJHb.852 187$pl3.192715@ pd7tw3no>...

I'm trying to make a search engine for a reasonably complex database that was originally developed by someone else in Access. I've ported the data to mySQL and am reasonably happy with everything except the performance I'm
getting from queries with multpile joins.


Index all fields referenced in JOIN, WHERE, GROUP BY, and ORDER BY
clauses.

Cheers,
NC

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

175
11500
by: Sai Hertz And Control Systems | last post by:
Dear all, Their was a huge rore about MySQL recently for something in java functions now theirs one more http://www.mysql.com/doc/en/News-5.0.x.html Does this concern anyone. What I think is PostgreSQL would have less USP's (Uniqe Selling Points
67
12555
by: Bob Powell | last post by:
To whom it may concern: I find the recent articles in various trade publications a little disturbing due to the lack of PostgrSQL mention. I continue to see articles about how IBM may be considering MYSQL for development an open_source web database. Why isn't PostgreSQL being considered or talked about by major industry giants? As a DBA I know that Postgres is far superior to MYSQL but if the industry directs it's energies towards...
2
1473
by: sathyashrayan | last post by:
dear group, I have been working VC++ for some time. My company assigned me a task for an online dictionary search site similar to the onelook.com which I have to make it in php mysql. Since I never did any of the project in the search engine , can any one guide me to the above? I am really struggling to understand the following: When I enter a word in a text it searches the definition of the word from the web site but not the home page...
5
2495
by: Martien van Wanrooij | last post by:
I have been using phpdig in some websites but now I stored a lot of larger texts into a mysql database. In the phpdig search engine, when you entered a search word, the page where the search word was found was displayed with about 2 lines before and 2 lines behind the search word itself. Let us say you look for "peanut butter" an the word is found in a larger text about sandwiches, even when it is on the 40th line of the text you would get...
0
1342
by: taras.di | last post by:
I'm trying to understand why MySQL isn't using all parts of the primary key when I add in an OR statement in the query. I have a people database, and a distances database. The people database lists a person's name and their location, the distances database contains the distance between any two points in the country. There are an roughly 15000^2 entries in the distances table, and currently about 100 entries in the people table. The...
0
1152
by: John | last post by:
http://www.teenwag.com/search?q=sports+illustrated&btn=Search http://www.teenwag.com/search?q=%09+Antonella+Barba&btn=Search http://www.teenwag.com/search?q=%09+Anna+Nicole+smith&btn=Search Accelarated and GZIP compressed Served deliciously by Lighttpd PHP 5 Search engine driven partly by google and partly by Lucene Index size 42 million
2
977
by: kbipul | last post by:
Hi In a web application , I need to create an aspx page(in C#) which can serach the files present on the server at the specified locations. The search parameter may be the file name, extn name, location, fully or partly. The resulting file names should be displayed in a datagrid. I am clueless about the functionality involved to create this search engine. Can anyone help me?
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.