Hi, i need some help, since mysql benchmark don't work well on select i need help with a query
what will be the fastest way? to use this query:

select * from news n, users u where n.users_id = u.users_id and u.users_id = '1' limit 0, 20

using like this is pretty slow (table are indexed, over 1 billion records)
My question is: if i put this query in a stored procedure and then call it

call showNews(userx)

will be faster? and use lower cpu resources?
Thanks

Member Avatar for 1stDAN

No, stored procedure won't be faster for it executes the very same query. You should show the EXPLAIN and both create table statements. With correct keys and indexes you can speed up query dramatically. Wrong indexes for example wrong foreign key or autoincrement ID may slow down speed

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.