PostgreSQL nested queries performance [closed] - postgresql

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Are there significant performance issues when using nested(2 level deep at max) queries in PostgreSQL?
I use version 8.4.2
I am asking because I am planning to use quite a lot of those soon on a busy website..

The boring answer: it depends on the query and your data.
To write (and read and understand) a nested query might be easier than writing a non-nested one, but you might end up paying the price in reduced performance. During my previous database project we ended up rewriting quite a few of the more critical queries to avoid nesting and we saw order of magnitude performance improvements.
EXPLAIN is your friend. You should learn to love it and how to use it :)
http://www.postgresql.org/docs/current/static/sql-explain.html

Not really.
If you want to improve, does not forget to runs analyze on all tables periodically.

Your question is waaaaaaaaaaaaaaaaaaaaaaay too general. There isn't any inherent issue with using "nested" queries in Postgres, no matter how many levels deep. You need to post specific queries if you have issues.
Additionally...if you're designing a new system, then why 8.4 and not 9.0? And even on 8.4, you should update to 8.4.5.

Related

high volume database choice for php [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am about to develop website using YII framework. But i am not quite sure about which database i should use.
Generally insertion and selection would be there in a website. Data would be come from different relational tables as i will have more than 50 filters so that user can see what ever database they want to see.
Here is the example of website. http://property.sulekha.com/
I want to design something like this.
which new concept i can use for the optimization, for better performance.
I have few concept in my mind which i am supposing to use.
1) MemCache
2) HipHop PHP
3) Doctorin ORM
I am just wondering how facebook search is working, are they using any advance tool for search??????
Facebook architecture is a fascinating one, and you shouldn't try to copy it, because you don't need it, and as we all know, premature optimization is the devil.
scaling issues are not something you prepare for, unless you're working for an enterprise and know first hand that you'll recieve huge amounts of traffic from day 1, like the new mega.
if you're talking about a large de-normalized table, which sounds so by applying up-to 50 filters, maybe you should consider a NoSQL solution, like mongoDB.
from what I know about facebook search, is that the servers are clustered, and are basically pointers to the "real" data, which means that alot of their data isn't a physical one, but as I said, unless you plan on sporting 1 billion users - that's over your head as of now.
good luck

Why must books teach to use datasets [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Where ever I read I see experts writing to stay away from typed datasets and use the entity framework or similar.
On the other hand almost every ado.net book I read will show first how to use datasets and some of them only use datasets, that gives me the impression that its not bad. if it is why teach it for the new programers?
All depends on what you want to do with the data you're pulling from your DB.
I use a DataSet to load data in to a Crystal Report because it plays well together. Anywhere else in my app i use mostly anonymous types. Either way i use the EntityFramework to pull the data from my DB. I get results much faster that way than using ADO.NET and DataSets. If i need raw performance I use ADO.NET. For batch updates for example.

Nosql Database suggestion for high performance [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
We have requirements that force us to have two layers of databases. A good caching solution backed by large distributed database. We are thinking to use redis for fast read and write. We are not yet settled for the database at backend, however we would prefer it to have following properties:
consistent over time.
robust (no data loss).
reasonably fast read.
distributed.
We are exploring cassandra and Mongodb as our options. Hbase might be a option too. Kindly let us know your views/ current state of work. We are expecting some comparative analysis which could be like in http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis , but should be more upto date and can give us better insight. An example usecase could be like when someone post a comment in facebook. The comment is then visible to all its friends in real time.

What is an "Object Database" and when is it beneficial to use one? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm quite familiar with what I understand to be relational databases such as mysql where you have tables, rows, columns and joins to figure out how content relates.
Someone suggested I use an object database for a project I'm busy with but I don't know what an object database is nor when it would be beneficial over a relational database.
I have already googled, wikipedia is a wealth of information (yes, sarcasm) and I must admit the few links I followed were not particularly enlightening. I therefore turn to the future google; crowd sourcing information. Does anyone know a good article I can read, or could anyone explain it to me.
Thanks in advance.
The main idea behind an object database is that you would be storing the objects as is inside your database, e.g. not breaking them up into relational constructs like tables with rows and columns.
The basic premise is that retrieving an object from such an object database would be much simpler - just "grab" the object, no mapping, no translation or anything needed.
See some links for more information:
db4o (db4objects) - maker of an object database for .NET and Java (open source)
ODMBS.org - site with lots of good (and freely useable) information on ODBMS
The biggest challenge for OO-DB is making the finding and retrieving of those objects stored as simple as possible, and also provide good performance. And their lack of widespread use also hinders their adoption.

nosql databases - what are these good for? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Recently I watched some old Oredev presentation on NoSql databases. I learned a bit but I still don't know when these databases are typically used. When it's good to use one and when it's not? Before I start learning any it would be great to know if there will be any opportunity to use one. Do You have suggestions on what db to try first? I'm working in .NET, learning some Ruby.
I learned a bit but I still don't know
when these databases are typically
used. When it's good to use one and
when it's not?
I would recommend to read for example these:
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
35+ Use Cases For Choosing Your Next NoSQL Database
The NoSQL Ecosystem
Before I start learning any it would
be great to know if there will be any
opportunity to use one.
Opportunity knocks at the strangest times. It's not the time that matters but how you answer the door.
Do You have suggestions on what db to
try first?
If you have .NET background try to look at MongoDB or CouchDB. Answer to this question however may depend on what is your scenario or what is the nature of your problem where you want to apply NoSQL solution.
Here you can read something about:
The Big List of NoSQL Use Cases
I think that MongoDB is a good starting point.
Getting Started with MongoDB and C#