May 23, 2012, 09:10:30 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: follow us on twitter @dotdragnet
Home
Help
Search
Login
Register
DotDragnet
>
The Tech Side
>
Tech stuff
>
slow searching views on Mysql....
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: slow searching views on Mysql.... (Read 512 times)
Scooby
Full Member
Posts: 163
slow searching views on Mysql....
«
on:
September 07, 2010, 02:18:41 PM »
Hi all.
I'm having some problems with slow searching of a view that unions two tables in mysql...
table one, is large with lookup contents for some 1.2m records
table two, same stucture but with local custom records - circa couple of hundred.
each get updated fairly regularly, they are unioned together to form one view to search from.
The user searches a view to return a record, but it is painfully slow. searching either table directly returns result relatively quickly, but searching the view can be minutes.
whats the best way to overcome this...? can I index views? I can't seem to find anything relatively recent?
if not, is there some nifty php to use one query to search both tables one after the other.... will have a unique identifier across both tables.
Thanks in advance.
Scoob
Logged
JasonD
Global Moderator
Hero Member
Posts: 551
Re: slow searching views on Mysql....
«
Reply #1 on:
September 07, 2010, 07:06:59 PM »
Two simple fast queries is generally faster than one complex slow query.
Would need to know more on how the tables are structured and what the view and/or other parts of the query say to suggest anything specific. An EXPLAIN query may help, or not.
Logged
Scooby
Full Member
Posts: 163
Re: slow searching views on Mysql....
«
Reply #2 on:
September 08, 2010, 02:05:54 PM »
Cheers, I've gone for an if / else check for now, and I'll see how it goes.
Logged
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> General Discussion
=> Jee's Forum of Appalling Jokes
-----------------------------
The Creative Side
-----------------------------
=> Arty stuff
=> Photography
=> On the web
-----------------------------
The Tech Side
-----------------------------
=> Tech stuff
=> Hardware & Software
-----------------------------
The Business Side
-----------------------------
=> Anything business related
-----------------------------
The Practical Side
-----------------------------
=> Practical Advice
DotDragnet
>
The Tech Side
>
Tech stuff
>
slow searching views on Mysql....
Loading...