473,385 Members | 1,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

performance versus order of fields in row

I'm not looking for an exact answer here, but instead something more
"rule of thumb". If I have a table with many fields, and I retrieving
small groups of fields during a SELECT, whereby the groups of fields are
indexed and/or clustered, will I get a faster select in the left-most
fields, or the right-most fields? Or will it not matter? It would be
unusual to SELECT *, I expect to be selecting groups of 4 to 16 fields,
and I am wondering if the most often occuring queries might be improved
by placing them at left or right ends of the table (or if there is any
help at all doing this). The selected groups of fields are unlikely to
be used as a search criterion, but instead as simple read-only, while
other fields determine if the row will be included.
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #1
3 1305
"D. Stimits" <st*****@comcast.net> writes:
I'm not looking for an exact answer here, but instead something more
"rule of thumb". If I have a table with many fields, and I retrieving
small groups of fields during a SELECT, whereby the groups of fields are
indexed and/or clustered, will I get a faster select in the left-most
fields, or the right-most fields? Or will it not matter?


Fields earlier in the table definition (further to the left) are
marginally faster to access than ones further to the right. I doubt it
would be real noticeable unless you had hundreds of fields altogether.

regards, tom lane

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

Nov 12 '05 #2
Tom Lane wrote:
"D. Stimits" <st*****@comcast.net> writes:

I'm not looking for an exact answer here, but instead something more
"rule of thumb". If I have a table with many fields, and I retrieving
small groups of fields during a SELECT, whereby the groups of fields are
indexed and/or clustered, will I get a faster select in the left-most
fields, or the right-most fields? Or will it not matter?


Fields earlier in the table definition (further to the left) are
marginally faster to access than ones further to the right. I doubt it
would be real noticeable unless you had hundreds of fields altogether.


Do we still "cache" field offsets for not-nullable-fixed-size columns?
Jan

--

#================================================= =====================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================= = Ja******@Yahoo.com #


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #3
Jan Wieck <Ja******@Yahoo.com> writes:
Tom Lane wrote:
Fields earlier in the table definition (further to the left) are
marginally faster to access than ones further to the right. I doubt it
would be real noticeable unless you had hundreds of fields altogether.
Do we still "cache" field offsets for not-nullable-fixed-size columns?


Yeah, we do, but I didn't think he wanted to get into that level of
detail ... in any case it's a safe bet that earlier fields are no slower
than later ones.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Fred | last post by:
Has anyone a link or any information comparing c and c++ as far as execution speed is concerned? Signal Processing algorithms would be welcome... Thanks Fred
0
by: Mark Jay Johansen | last post by:
Does anyone know what the relative performance would be of using updateable result sets versus using individual insert or update statements? (Specifically at the moment I'm dealing with JSP...
1
by: Kevin Frey | last post by:
Hello, I have a test database with table A containing 10,000 rows and a table B containing 100,000 rows. Rows in B are "children" of rows in A - each row in A has 10 related rows in B (ie. B has...
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
16
by: D. Stimits | last post by:
A non-profit organization is interested in a new data application that would use a SQL storage system. I'm interested to know how non-profit companies that are not selling products are considered...
15
by: Együd Csaba | last post by:
Hi All, I've a problem with the perfprmance of the production environment. I've two db servers. One on my laptop computer (2Ghz, 1GB, WinXP, Cygwin, Postgres 7.3.4) and one on a production server...
3
by: MP | last post by:
context: vb6/ ado / .mdb format / jet 4.0 (not using Access - ADO only) - creating tables via ADO (don't have access) - all tables have a primary key (PK) - many of the PK will become FK(Foreign...
36
by: mrby | last post by:
Hi, Does anyone know of any link which describes the (relative) performance of all kinds of C operations? e.g: how fast is "add" comparing with "multiplication" on a typical machine. Thanks!...
4
by: Jana | last post by:
Hi! I have an Access 97 report based on tables linked to an SQL back end. The report has 5 subreports in it (unfortunately unavoidable due to the nature of the report) and performance is quite...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.