Sasa Posted November 26, 2009 Report Share Posted November 26, 2009 izrāvumns no http://net.tutsplus.com/tutorials/other/10-essential-sql-tips-for-developers/ Therefore, if you're using indexing, you'll probably be perplexed as to why your query is taking forever, when it should be a simple index scan. This is the reason that developers need to pay special attention to data types and their applications. Non-key attributes which are IDs are often string types, as opposed to integers, because of the increased flexibility that is granted. However, this is also a trouble area for junior developers, who assume that ID fields will be integers. Kā ID fields var nebūt integers kā tad strādās autoincrement, agrāk biju pārliecināts, ka ID ir vesels skaitlis, un tas arī tā visu laiku paliks! :| Quote Link to comment Share on other sites More sharing options...
Gints Plivna Posted November 26, 2009 Report Share Posted November 26, 2009 Pirmkārt tur iet runa arī par citām DB nevis tikai MySQL. Visās DB nav tāda jēdziena kā autoincrement. Otrkārt neviens jau nekavē izveidot ID kolonu bez autoincrement. Primārā atslēga jau var būt viena kolona, divas, n kolonas no kurām katra var būt int un var nebūt. Otrkārt datu tipus ir jāskatās ne tikai DB tabulai, bet lai arī tie b;utu tādi paši select vaicājumā, ko tu padosi. Gints Plivna http://datubazes.wordpress.com Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.