It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Is Read Consistency Rollback segments a feature of Oracle products or a general feature of RDBMS?
Same question but this time regarding Storing/Tablespaces?
Lastly are blocks, extents and segments a feature of Oracle or databases in general?
Many thanks in advance to your replies!
Read consistency is an attribute (from my perspective a requirement) of a transactional database.
Rollback segments are (in a nutshell) how Oracle supports transactions. Btw. it's not called rollback segement any longer. It's called UNDO nowadays
Tablespaces are nothing unique to Oracle. Most (if not all) large scale DBMS support that.
All DBMS I know access the filesystem by blocks. A block (sometimes called a page) is usually the smallest (storage) unit a DBMS can read or write.
Extents are nothing unique to Oracle. Other DBMS just have different names for that.
Segments is a name I have only come across in the Oracle world. But I guess the concept exists in any major DBMS in some way or the other.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I find that creating SQL tables tedious when starting to create a web app (ASP/Python/PHP).
Do you guys know any tools that makes creating tables quicker and faster and easier? Thanks in advance! :-)
In my opinion writing a CREATE TABLE statement is far less tedious than writing HTML pages.
The recommended approach is to use a ER design tool co create and define your database model. Most (if not all) ER designer can then create the necessary DDL statement directly from the model.
With this approach you also have a documentation of your database model which is always a good thing.
It depends on the tools/libraries you use to create your app.
If you use an ORM, many ORMs offer you the possibility to create the database with all tables automatically, according to the classes and mappings you defined in your application.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
If I make sure only alpha-numerical characters are used in queries I should be free of any SQL injections, right?
SQL Injection Prevention CheatSheet
Bullet points:
Defense Option 1: Prepared Statements (Parameterized Queries)
...how all developers should first be taught how to write database queries.
Defense Option 2: Stored Procedures
...when implemented safely.
Defense Option 3: Escaping All User Supplied Input
...frail compared to using parameterized queries.
It's pretty difficult to write a useful query with only alpha-numeric characters. Use paramterized queries, don't look for a non-shortcut shortcut.
Technically, that's probably correct, since it would block using -- or similar trickery. Most platforms these days have much more robust methods for properly escaping input and keeping it from affecting the database in unintended ways, however.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
What is the purpose of table hints in SQL Server like NOLOCK and READUNCOMMITTED?
Please explain this with example.
Also why can't they be specified for tables modified by INSERT, UPDATE, or DELETE operations?
They allow you to set transaction isolation level on a table-by-table basis instead of for the entire query or connection.
They can also be used to trigger some features like minimal logging (use TABLOCK with the right trace flags set on an INSERT and it can be minimally logged).
As a rule it's a better idea to use connection-level settings.
As the commentor pointed out, Books Online has an excellent description (and samples) of Table Hints, including which hints can be used for which operations.
http://msdn.microsoft.com/en-us/library/ms187373.aspx
There is also a big fat caveat at the top of the page, which often goes unnoticed:
Caution Because the SQL Server query optimizer typically selects the
best execution plan for a query, we recommend that hints be used only
as a last resort by experienced developers and database
administrators.
While the accuracy of the optimizer in choosing the best plan can be debatable, the latter half of the warning is certainly true; don't use Table Hints unless you are sure that you need them, and that assurance typically only comes with experience.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have worked on several rails applications and now I work on a very complex one, from the database side. A lots of nested models, several polymorphyc associations...
How you deal with that complexity ? How can I know that we are working in the good direction ? What about performance issues ?
Thansk for your opinions.
First of all, you need to estimate the performance of the queries that your application runs against the database. Then you can try to optimize the queries, for example, by adding some indexes. Maybe in some cases you will also need to consider denormalizing some data to get better performance.
Performance of the queries may also depend on your data size. If you have really big data set and queries are optimal, then you may consider introducing (distributed) caching. Or if data model allows that think of partitioning your database on several nodes to improve query performance.
But still the first step should be a setup of some SQL query performance monitoring.
You should consider a NOSQL solution such as MongoDB or CouchDB. Sometimes an RDBMS is not the right tool for the job.
http://www.mongodb.org/
http://couchdb.apache.org/
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I need to find the best solution to make the DB Normalized with large amount of data expected.
My site has a Table Tags (contain key word,id) and also 4 types of data related to this tags table like(articles,resources,jobs,...).
The big question is:-
for the relation with tags what best solution for optimazaion & query speed?
make a table for each relation like:
table articlesToTags(ArticleID,TagID)
table jobsToTags(jobid,tagid)
etc.
or put it all in one table like
table tagsrelation(tagid,itemid,itemtype)
I need your help. Please provide me with articles to help me in this design
consider that in future the site can conation new section relate to tag
Thanks
I would go for the normalized version of your schema (which is the table-relation). This type of schemas are very useful for scenarios where the application might grow.
The bad thing of having all the data in just one table is that if you have a bunch of attributes for both relationships, you'll end up with a table with a lot of attributes, which when growing will be slow to query, thus becoming a performance hit of your app.
So, finally the problem is to choose simplicity and quick end against well designed code considering scalability as well.
Hope I can help