Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

mysql - How can I simplify this Wordpress query to increase performance? -


i have several boxes in wordpress site have show selection of posts belong categories , not belong several others. using native wordpress tools result query this:

select sql_calc_found_rows  wp_posts.* wp_posts inner join wp_term_relationships on (wp_posts.id = wp_term_relationships.object_id) inner join wp_term_taxonomy on (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) 1=1 , wp_term_taxonomy.taxonomy = 'category' , wp_term_taxonomy.term_id in ('1', '49') , wp_posts.id not in (      select tr.object_id     wp_term_relationships tr     inner join wp_term_taxonomy tt     on tr.term_taxonomy_id = tt.term_taxonomy_id     tt.taxonomy = 'category'     , tt.term_id in ('3394', '49', '794', '183') ) , wp_posts.post_type = 'post' , (wp_posts.post_status = 'publish') group wp_posts.id order wp_posts.post_date desc limit 0, 5; 

now quite expensive , ends in slow queries log. i'll gladly drop wordpress way , build query manually. first thing can eliminate need wp_term_taxonomy table (i can use term_taxonomy_id instead of term_id, never understood why wordpress needs both) still have not ( subquery ) problem due categories excluded.

so considering i'm free (like create other "service" tables if might help), what's best way speed search under these conditions?

i don't see need subquery, tables it's using in main query! exluding stuff should simple matter of adding more statements.

can't edit line

and wp_term_taxonomy.term_id in ('1', '49') 

to

and wp_term_taxonomy.term_id in ('1', '49') , wp_term_taxonomy.term_id not in ('3394', '49', '794', '183') 

..and removing subquery completely?


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -