|
|
Teaching old dogs new tricks.
Well I rarely use implicit joins, and do you know why, you can't decide the order of the joins (outer) if they're implicit. Better get used to a consistent way of doing things.
One reason that the old people use implicit joins is that on Oracle the optimizer was for a long time better at handling implicit joins.
But sometimes when I don't get the performance I expect I try implicit joins instead of ANSI joins.
It's all about the order of execution. (I'm having an article about that on the way)
|
|
|
|
|
Jörgen Andersson wrote: One reason that the old people use implicit joins is that on Oracle the optimizer was for a long time better at handling implicit joins. I actually read that today
The reason I don't like it is because it really obscures your where clause and invites bugs because you forgot to join two tables in the where clause (actually happened today, that's why I read about it).
It shouldn't matter for your performance though, so I was pretty surprised it DOES matter for performance in Oracle (and not in the way that you want either).
|
|
|
|
|
The best part of Oracle is that I rarely have to use it anymore.
I even hate the Gigs of pollution you had to install just to talk damned thing.
So now when I have to talk to it from VS I just add one file to my project (Oracle.ManagedDataAccess.dll) and then have all the access I need.
The bare minimum
|
|
|
|
|
RossMW wrote: The bare minimum Still too much
|
|
|
|
|
Yep.
|
|
|
|
|
It''s interesting to read the comments in this thread.
Having worked for many years on Oracle, but now having changed company to work with SQL server, I have quite different experience.
SQL Server is a much less mature product. It really feels like going fifteen years back in time.
Programming in T-Sql feels like using prehistoric VB, the code is totally littered with stupid prefixes like @ and #. And it lacks consistency.
The worst part is probably lock handling, on Oracle I never needed to think about it, period.
No flashback queries. On Oracle you can do a SELECT AS OF TIMESTAMP . Even from dropped tables.
Always on failover is a really poor substitute for RAC. Half the point with clustering is gone if you can only use one node at a time.
Composite indexes are only having statistics on the first column, reducing the efficiency of the optimizer considerably.
No pipelined functions, at all.
I can keep on going for long.
On the other hand, SSIS is just brilliant.
|
|
|
|
|
|
You can think of pipelined functions in the same way as yield return in C#.
Flashback really is the best thing since sliced bread. It's a bit of a performance drain, but still faster than SQL Server though.
Ever wondered why you get the query time in seconds in SSMS and in ms from Oracle?
Sander Rossel wrote: Unfortunately, due to awful tooling from Oracle
Well, I certainly give you that one, SSIS is simply awesome despite some quirks.
Sander Rossel wrote: you're actual DBA's
I'm not, I'm both a backend developer and database developer. No admin in my title to be found.
Sander Rossel wrote: but that's not very interesting to the average developer?
That's maybe where the problem is. People don't understand what's going on in the databases, and SQL-Server is much better integrated with Visual Studio so it's really quite hidden from people.
I once saw someone here comment that the biggest problem with Access is that it makes it to easy for people that don't know what they are doing to create a database. Well that statement really holds a bit of truth for SQL Server as well.
That's also why we're seeing these reactionist NOSQL databases which is really bringing us back to the sixties.
BTW, one of the big differences between PL-SQL and T-SQL is that there is a lot of implicit stuff going on in T-SQL. In PL-SQL you have to define everything. And that's probably why you thought you can only have one return set from PL-SQL.
|
|
|
|
|
Jörgen Andersson wrote: Ever wondered why you get the query time in seconds in SSMS and in ms from Oracle? I never got a timeout in Oracle and plenty in SQL Server...
I SHOULD mention that I haven't worked with Oracle like I have with SQL Server (few months development in Oracle vs. years of development and production in SQL Server).
Jörgen Andersson wrote: I'm not, I'm both a backend developer and database developer. No admin in my title to be found. Still, your profile says "Database developer" rather than "Software developer"
Jörgen Andersson wrote: People don't understand what's going on in the databases Very true, although my experience is that people don't know what's going on inside C# (or any technology for that matter) as well.
Most people are missing theoretical knowledge because that's just not interesting, we're practical and need results
Just recently a coworker complained that a SELECT TOP 10 * FROM SomeView was very slow so we should move the select statement from the view to an SP and pass in the TOP 10 as parameter to that SP. Yes, because that's certainly going to make it a lot faster... (his idea was actually that the entire view was selected (and the view didn't have a top 10) and that the top 10 was applied after that).
Jörgen Andersson wrote: That's also why we're seeing these reactionist NOSQL databases which is really bringing us back to the sixties. I have to disagree there! I'm no NoSQL expert, but I really think NoSQL databases solve actual problems and can be successfully leveraged to create highly performant systems where traditional relational databases would fail miserably. Of course you still have to know what you're actually doing.
Jörgen Andersson wrote: that's probably why you thought you can only have one return set from PL-SQL Nope, I actually want to see exactly this[^] in SQL Developer, but it's impossible
|
|
|
|
|
Sander Rossel wrote: I never got a timeout in Oracle and plenty in SQL Server.
Probably a setting though.
Sander Rossel wrote: his idea was actually that the entire view was selected (and the view didn't have a top 10) and that the top 10 was applied after that)
He might be right you know, check the plan.
That's also why you should avoid views with joins as the plague! I never use views for anything but restricting access or prefiltering tables.
modified 18-Oct-16 17:54pm.
|
|
|
|
|
Jörgen Andersson wrote: He might be right you know, check the plan. HE MIGHT be right that an SP would be faster, but not because the TOP 10 is applied after selecting everything from a view
I did check the plan and it was really pretty hopeless.
Basically the view was this:
SELECT SomeFields
FROM BigTable
WHERE ...
UNION
SELECT SomeOtherFields
FROM BigTable
WHERE ...
Now to get that to work we probably DO need an SP because to get the top 10 the selects on both sides of the union needed to be completely evaluated, then sorted, and then top 10'd.
I wouldn't really know how to optimize that in a view. It's probably faster to take both top 10's, union and sort those and take another top 10
|
|
|
|
|
Sander Rossel wrote: , but not because the TOP 10 is applied after selecting everything from a view
Sander Rossel wrote: because to get the top 10 the selects on both sides of the union needed to be completely evaluated, then sorted, and then top 10'd.
That's a bit contradicting you know.
Sander Rossel wrote: It's probably faster to take both top 10's, union and sort those and take another top 10
That's it.
And that's exactly why I avoid views. You're forgetting what's happening underneath.
|
|
|
|
|
Jörgen Andersson wrote: That's a bit contradicting you know. You can't say "a TOP X is applied after selecting everything from a view" for views in general.
It's true for this particular view, but you only know that after looking at the view. Besides, the WHERE clause was still applied even before "selecting everything"
|
|
|
|
|
It doesn't have anything to do with the view, it's because the TOP is the last thing to happen in the logical order of execution.
|
|
|
|
|
It is maybe the order I learned things, but I do not find Oracle that difficult (my first was DB2 on mainframe), but it seems to be less advanced than MSSQL these days, so can't see any reason to bother with in the first place (it even seems to me that most free RDBMS offer more than Oracle for some problems)...
So. No good words for Oracle...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Kornfeld Eliyahu Peter wrote: So. No good words for Oracle... It's pretty hard to get some praise for Oracle it seems...
|
|
|
|
|
I do see a number of benefits to Oracle.
It is really good at crunching really huge volumes.
It commands extraordinary rates for consultants
It takes a DBA to maintain it
I think it requires a larger hardware footprint.
It is an absolute f***ing pain in the arse to develop against.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: It is really good at crunching really huge volumes. And crunching your bank account.
Mycroft Holmes wrote: It commands extraordinary rates for consultants From your bank account.
Mycroft Holmes wrote: It takes a DBA to maintain it Who also won't stop to pillage your bank account.
Mycroft Holmes wrote: I think it requires a larger hardware footprint. I'm broke and can't pay for better hardware
|
|
|
|
|
I've worked on a project which used both Oracle and SQL Server, the latter was easy and the former lost me whole weekends trying to get the right DB/Driver combinations.
Objectively both have their strong points. Oracle is a very powerful database system whilst SQL Server is more flexible, easier and so much cheaper. If I was to start a new project tomorrow and had to make the decision I'd choose SQL Server, but I'd go to another level of ease and just use Azure SQL because, you know, geo-replication in a few clicks, huge resiliency and easy scale.
Eagles may soar, but weasels don't get sucked into jet engines
|
|
|
|
|
dazfuller wrote: and the former lost me whole weekends trying to get the right DB/Driver combinations. I had some 32/64 bits problem. Basically, because I installed a 64 bits client another 32 bits client refused to work
dazfuller wrote: I'd go to another level of ease and just use Azure SQL Oracle in the cloud? Now you have two problems
|
|
|
|
|
Oracle in the cloud, who would be that mad! I mean SQL Server in the cloud, Azure SQL
Eagles may soar, but weasels don't get sucked into jet engines
|
|
|
|
|
Take the time to learn Oracle properly and you'll be amazed by just how versatile it is. I've been going back and fourth between Oracle and SQL Server DBs (as well as the new "free" spin-offs) for several years now in a number of different environments, sure each have their merits but if I had to pick one it would be Oracle every day of the week.
Now I'm speaking purely from a DB development standpoint, Oracle is much faster, easily scalable and has far more practical, and TBH powerful, functions and program-ability features than any other DB I've come across so far. Yes I'm talking RDBMS.
It's performance tuning capabilities are phenomenal. But again I stress, you need to take the time to learn it properly, those people who are "SQL experts" will always complain about how Oracle is so unnecessarily complex blah blah blah, it's because it was never designed for someone with no development experience to write basic reports on.
|
|
|
|
|
We were forced to Upgrade from MSSQL to Oracle 7 in order to land a BIG contract. During the process, we found MSSQL Allowed Duplicate keys (Identity Column) to exist. It boggled our mind, it caused us to realize we lost data.
From that point forward, I fell in love with Oracle. It was way faster, way more stable. And a bit more complicated. I bemoaned the lack of Autoincrement fields and having to write triggers and use sequences, UNTIL I learned to just do it the Oracle way, and everything got easier, and scaled pretty well...
I became a bit of an Oracle Bigot for 10+ years. Until they recently started "License Auditing". Now I have no problem paying for the tools we use. But I watched companies have to full license a development oracle machine (outside of production), and a hot backup server (they want the DB shut off until failover, or pay).
For a small DB, you can use the free XE version which is good. But go beyond that and the costs stack up for smaller companies.
Friends at Siemens said they will NEVER start a new Oracle Project because of the fines they paid.
They will eventually phase most of it out.
I am of a similar mindset. I have no interest, after 2 decades of Oracle Specialty of starting a new Oracle Project. MSSQL has gotten a lot better (transactions still grind me, reads being blocked by a write, 2 people can't update master-detail tables at the same time without lock issues)...
But I can't justify Extortion...
|
|
|
|
|
Kirk 10389821 wrote: we found MSSQL Allowed Duplicate keys (Identity Column) to exist I'm not sure what version that was, but that's certainly not possible now
SQL Server does allow you to not specify a key though, in which case it IS possible to insert duplicate rows (I really can't recommend it).
Kirk 10389821 wrote: But I can't justify Extortion... In a time that lots of databases are free/open-source
What always struck me with Oracle is that they're arrogant. They're the most expensive. Their security chief wrote that letter[^] basically saying "we know everything, you know nothing". Then there's the whole Oracle vs. Google lawsuit about Java while they're letting the Java EE platform die a slow death...
Maybe they're not worse than Google, Microsoft, Facebook, etc., but it sure seems that way (with Apple being a close 2nd)
|
|
|
|