# Run Large PlanetScale Queries in Laravel With DB::olap()

DevFeed: [Run Large PlanetScale Queries in Laravel With DB::olap()](<https://devfeed.tech/articles/run-large-planetscale-queries-in-laravel-with-db-olap-89997.md>)

Original publisher: [Read original article](<https://laravel-news.com/laravel-planetscale-olap>)

Author: Paul Redmond

Published: 2026-10-19T02:22:57Z

Content type: news

Language: en

Sources: [Laravel](<https://devfeed.tech/sources/laravel.md>)

Topics: [olap](<https://devfeed.tech/topics/olap.md>), [Laravel](<https://devfeed.tech/topics/laravel.md>), [Rockset](<https://devfeed.tech/topics/rockset.md>), [Eloquent ORM](<https://devfeed.tech/topics/eloquent.md>)

Tags: [added](<https://devfeed.tech/tags/added.md>), [csv](<https://devfeed.tech/tags/csv.md>), [customer](<https://devfeed.tech/tags/customer.md>), [data](<https://devfeed.tech/tags/data.md>), [database](<https://devfeed.tech/tags/database.md>), [databases](<https://devfeed.tech/tags/databases.md>), [groupby](<https://devfeed.tech/tags/groupby.md>), [join](<https://devfeed.tech/tags/join.md>), [laravel](<https://devfeed.tech/tags/laravel.md>), [laravel-tutorials](<https://devfeed.tech/tags/laravel-tutorials.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [olap](<https://devfeed.tech/tags/olap.md>), [orders](<https://devfeed.tech/tags/orders.md>), [php](<https://devfeed.tech/tags/php.md>), [planetscale](<https://devfeed.tech/tags/planetscale.md>), [query](<https://devfeed.tech/tags/query.md>), [vitess](<https://devfeed.tech/tags/vitess.md>)

## AI overview

Laravel 13.36 adds DB::olap() to run a callback's queries in Vitess OLAP mode, then restore OLTP mode. The method handles both read and write connections and does nothing special for non-Vitess databases. The article recommends it for occasional large exports, backfills, and admin reports, while cautioning against routine application queries.

## Source excerpt

Laravel's new DB::olap() method runs PlanetScale and Vitess queries in OLAP mode to get past the 100,000 row limit, then switches the connection back. The post Run Large PlanetScale Queries in Laravel With DB::olap() appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.