Unix Technical Forum

(NONE)

This is a discussion on (NONE) within the pgsql Sql forums, part of the PostgreSQL category; --> For example, consider the queres: SELECT * FROM table1 WHERE field1=1 AND field2=1; SELECT * FROM table1 WHERE field2=1 ...


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

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 11:51 AM
=?koi8-r?Q?=E9=CC=D8=D1=20=EB=CF=CE=C0=C8=CF=D7?=
 
Posts: n/a
Default (NONE)

For example, consider the queres:

SELECT * FROM table1 WHERE field1=1 AND field2=1;

SELECT * FROM table1 WHERE field2=1 AND field1=1;


These two queries are logically equivalent. But in all cases the planner generates a query plan that performs field1=1 condition, and then field2=1 condition, as there is a index on field1.

Is it possible to instruct the PostgreSQL query planner to perform field2=1 condition first, and then field1=1 condition?

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

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 03:38 AM.


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