Host unlimited blogs, sites, forums for $4.95 only with this host

PostgreSQL Hosting : what is wrong with this quuery

Finding a good web host for your database sites is a big problem. Check our recommended host for database hosting or the datacenters with the most powerful and reliable dedicated servers suited for large databases.

This databases discussion was started by saasira on 20 July 2009

best database hosting

Can some one explain me how to optimise this query?

select disticnt(csuser.id), csuser.loginName,csuser.displayName,loginSession.l astlogindatetime,loginSession.activesessions,usert ypes.csusertypeid from User csuser join userroleassign csuserroleassign on csuserroleassign.roleid=52 left outer join userloginsession csloginSession on csloginSession.userid=csuser.id left outer join userusertypeassign usertypes on usertypes.userid=csuser.id limit 15;

If I don’t add that distcint keyword, query is returning results in 18 milli seconds; but if I add distcinct it did not return results in two miunutes and finally I have to stop the exection of the query.

Interestingly, if I say select distinct(user.id) from user; then it is pretty quick and returning in 15 milliseconds.

Sorry for asking such a basic question but I’m not that good at SQL
.

Learn more PostgreSQL databases here. Should you need to go for trustworthy hosting services for all database related sites, we suggest this host for virtual database hosting and this one for dedicated databases hosting

This entry was posted in Databases Bookmark this post and come back later for the best web hosting coupons.

This web hosting blog is proudly hosted with reliable Hostgator webhosting for only one cents through this hostgator coupon. If you're new here, you may want to subscribe to this web hosting RSS feed

-->