dbTalk Databases Forums  

how to optimize the query that returns only one result

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss how to optimize the query that returns only one result in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
owen nirvana
 
Posts: n/a

Default how to optimize the query that returns only one result - 08-17-2006 , 08:46 PM






for results , we access it using iterators usually.
But in case we will get one result apparently, we hope to directly access data.
is it possible?

--
gtalk:freeespeech (AT) gmail (DOT) com

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: how to optimize the query that returns only one result - 08-18-2006 , 01:43 PM






owen nirvana wrote:
Quote:
for results , we access it using iterators usually.
But in case we will get one result apparently, we hope to directly
access data.
is it possible?
Have you profiled the code? If not, how do you know that such an
optimization will even help?

In virtually all situations, the speed bottleneck is either I/O
(network, disk...) or the database itself. Unless you have a very
unusual situation, speeding up MySQL++ should only help significanly if
there is a massive inefficiency in the library somewhere. The only such
inefficiency I'm aware of is that it copies data too many times, but
that only matters for large result sets, not small ones like what you're
talking about.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
owen nirvana
 
Posts: n/a

Default Re: how to optimize the query that returns only one result - 08-19-2006 , 12:45 AM



sorry ,I think it's mistake about profile.

I hope not more simple code , but more efficient.

about a single result, I think it is not necessary write a whole loop.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.