Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reasons why SELECT * is bad for SQL performance | Tanel Poder Consulting #13

Open
utterances-bot opened this issue Nov 25, 2020 · 4 comments

Comments

@utterances-bot
Copy link

Reasons why SELECT * is bad for SQL performance | Tanel Poder Consulting

https://tanelpoder.com/posts/reasons-why-select-star-is-bad-for-sql-performance/

Copy link

Thanks for sharing! Now is more than proved.

Copy link

Great Tanel, good to know about the 12.2 sqlplus -fast options or the lob aggregation param, and overall pleasure to follow you step by step perf. analysis.

Copy link

Hi Tanel, thanks for sharing. Great post! Would you mind to shed some light on a way how to improve fetching milion LOB values to the app side?

Copy link
Owner

tanelpoder commented Jun 14, 2021

Thanks Tomasz.

You'd need to find a way to return lots of small LOB items by using some workarounds:

  1. Stream of non-LOB chunks - I remember writing PL/SQL for special cases many years ago, where we converted CLOB items to arrays of VARCHAR (or BLOBs to arrays of RAW) so many of them could be fetched in one go

  2. One single big LOB item that contains many smaller LOBs (probably the LOB items would be prefixed by a few bytes indicating the the next item size - runlength encoding).

  3. Use the new Oracle driver LOB settings with some pivoting operation (fetch 1 row with pivoted 100 LOB columns in result set, each column containing a separate LOB item...)

  4. Write the LOB items to filesystem and access them as files? (This might be useful during some migration or mass export perhaps)

The options #1/#2/#3 would require some app logic changes (or app-level stitching-together of the chunkified data)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants