
I enjoy unhealthy food and databases
Hemel Hempstead, East
Joined April 2010
- Tweets3.6K
- Following255
- Followers418
- Likes1.2K
Oracle performance quiz for the long weekend. How would you make this fast: count unique clients with unpaid invoices, stop counting at 99, expect 1m unpaid invoices. Basic sql: select count(*) from (select distinct client_id from invoice where status='unpaid') where rownum<=99
There will be about 100m total invoices, I’ve put together a DB fiddle with mostly random data dbfiddle.uk/17Rg3YxC (ratios are slightly different to advertised but shouldn’t matter too much)
1
246
Has anyone on Windows been able to install 19.18 oracle home from a gold image? Our process has worked for every other patch but this time it’s complaining about not being able to restore cloned files. @myoraclesupport is waiting for other users to raise before treating as a bug
Oracle performance: It seems that enabling large pages prevents direct path reads, unless _serial_direct_read=always. Currently raising an SR but has anyone looked into this before? Already tried reducing _small_table_threshold
If anyone wants to follow me on Mastodon, my handle is @SQL@mastodon.online (which probably suggests I’ve chosen a wrong server)
3
If you are currently testing DRCP in 19c then check drcp_dedicated_opt. It was defaulted to YES (it’s NO in 21c where it was released). Sessions you’d expect to be freed to the pool are no longer freed (if you haven’t reached max pool size) until they hit inactivity_timeout
3
This could be interesting (if valid) dba.stackexchange.com/questi… adding comments adds 2 seconds to run time. I expect it will be a boring measurement error though
2
1
Dbms_optim_bundle doesn’t work for Windows since 19.11 as it writes commands via utl_file, this command gets too long in 19.11 (so many bug fixes to enable) and the code the pl/sql uses to determine the max line size is off by one as it assumes a one character line break
Raised an SR yesterday for an optimizer problem that gets hit with an EM metric query (Doc ID 2697438.1). Optimizer transforms IN (subquery) to inner join when it later groups by but doesn’t count the number of rows. I can’t see the transformation helping, only hurting
I didn’t think I’d be disappointed by v$sql_plan.projection cutting off at ~4000 characters, but here we are
Computer is going into boxes for a few months while we move and get settled so I can’t finish the blog post I’ve been working on. It’s about using a domain index for queries with sysdate between start_date and end_date driving filters
1
7
Oracle distributed query believes that a primary key filter will use a FTS (it uses the primary key but cost reported locally is FTS). Rebuilt with CTAS and dbms_redefinition to copy stats etc fixes cost. Query is select pk_col from table@link cross join dual where pk_col = 1 🤔
Casual Oracle poll: are you using domain indexes (ignoring TEXT and Spatial)?
14%Yes
76%No, never considered
10%No, but I have a use case
21 votes • Final resultsFun oddity in MySQL, order of columns in a group by has influence on whether a first rows style plan can be used dbfiddle.uk/?rdbms=mysql_8.0… (requires the join to matter)
1
It’s a relief when you find out someone raised the bug you avoided raising because it would require too much patience. Bug 29765095 : EXCESSIVE PARSING TIME IN A SQL WITH MANY OR CLAUSES 18.4, it won’t solve the biggest problems with OR but the parse time is unnecessarily high


