Unix Technical Forum

Re: MSSQL versus Postgres timing

This is a discussion on Re: MSSQL versus Postgres timing within the pgsql Sql forums, part of the PostgreSQL category; --> > CREATE OR REPLACE VIEW viwassoclist AS > SELECT a.clientnum, a.associateid, a.associatenum, a.lastname, > a.firstname, > jt.value AS jobtitle, ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Sql

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 11:55 AM
PFC
 
Posts: n/a
Default Re: MSSQL versus Postgres timing



> CREATE OR REPLACE VIEW viwassoclist AS
> SELECT a.clientnum, a.associateid, a.associatenum, a.lastname,
> a.firstname,
> jt.value AS jobtitle, l.name AS "location", l.locationid AS
> mainlocationid,
> l.divisionid, l.regionid, l.districtid, (a.lastname::text || ', '::text)
> ||
> a.firstname::text AS assocname, a.isactive, a.isdeleted
> FROM tblassociate a
> LEFT JOIN tbljobtitle jt ON a.jobtitleid = jt.id AND
> jt.clientnum::text =
> a.clientnum::text AND 1 = jt.presentationid
> JOIN tbllocation l ON a.locationid = l.locationid AND
> l.clientnum::text =
> a.clientnum::text;



Try removing those ::text casts...
and creating two column indexes on the columns you use in your Join

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:31 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com