I mean slavery in ancient civilizations, for example Greece, Rome, Egypt. Not considering moral aspects at all, but considering economic reasons and agricultural nature of economic activity.
Slavery is an incredibly broad topic, with different cultures and different times practicing different forms of slavery. It also isn't a topic in which I consider myself an expert. So I'll offer a very broad brush response.
definition of terms
"economically effective" - I'm going to interpret this phrase to mean that a system is more economically effective if it produces more units of output/units of input. The answer might change if we were to assume that it meant "What is the minimum number of units of input/labor needed to produce a specific desired outcome?"
Slavery - For simplicity, I'm going to define slavery as ownership of an individual (who has restricted civil rights) and assigns part or all of the slave's productive output to the master. Different systems of slavery will restrict different civil rights, and will assign different portions of the slave's output to the master. I personally believe that modern people get confused because we think of "slavery" as "chattel slavery as practiced in the American South in the Ante-bellum era" - which was an unusual, and unusually brutal form of slavery. Historically slavery has been much more varied, and usually much less revolting.
Based on those two principles, I can answer without research.
I believe based on my reading that every human will be more economically efficient if they own the marginal product of their labor (extra labor results in extra wealth). I haven't yet discovered any example of a culture where slavery is more efficient than freedom.
Let's dive down into some examples - because this is a very broad brush survey answer, I'm not going to provide the level of sources/research that I believe is necessary for H:SE
Frequently slavery was the result of conquest. An individual captured in war agreed to give up civil rights and liberty in exchange for life. Sometimes the slave could be freed after a period of servitude - sometimes the individual would expect to become a part of the society once freed. Although the individual labored, there was no expectation that this labor would be "economically efficient" - it was just more profitable than killing the man.
Roman slavery took two distinct forms.
Urban Roman Slavery
In towns and cities slaves were economic units. Some were born to slavery, others were sold into slavery, others sold themselves into slavery. Many were taken in war. Roman slaves had some legal status, (although sometimes that legal status derived from their status as property - it is a crime to damage another man's property). They could own property, could buy their freedom, and when they were freed, were considered a member of their (ex) owner's household and clientele.
Rural Roman Slavery
Rural Roman slaves were, not to put too fine a point on it, beasts. They farmed the 'latifundia' and were either working or shut up in barracks. Everything I've heard about the latifundia suggests to me that this is the nadir of humanity, and only possible because they were out of view. This was perceived at the time as the optimum economic efficiency because the absolute minimum was spent on their maintenance, and they were driven to produce output.
I'm going to over-generalize here, but most of the rest of humanity in the Roman/Greek was in some form of slavery. Slavery doesn't have a strict formal definitions, but civil rights were a consequence of either (a) the military or governance power to assert a civil right - e.g. the aristocracy, or (b) derivative of a member of the aristocracy. Assume that < 10% are aristocrats with the weapons, nutrition, experience and ability to defend themselves. Everyone else was to some extent a slave - they relied on the aristocrats to grant and protect their civil rights. Yes, I'm overgeneralizing. Your lord determined what you did, what you earned, what you kept out of what you earned, whether you married, whether you lived or died, whether you were guilty of civil and criminal offenses. In most cases, you had no recourse and no appeal. You also had no chance to change your status. Again, I'm painting in very broad strokes here - my point is not to argue that I'm depicting history accurately, but rather to point out that the difference between a "serf" and a "peasant" and a "slave" is less clear than many people think.
Was that economically efficient? It was the only system they had. I would argue that slavery is always less efficient than freedom, and that any man will produce more when working for his own interests rather than a masters. Feudalism included a set of conventions & customs that ensured that the marginal value generated by additional effort was shared between the individual and the master/lord/ruler.
Final thought - this is a sensitive subject and I really dislike painting with this broad a brush. I don't think I've put my foot in my mouth and offended anyone; it was not my intent. But when dealing with oppression, there is always the chance that I'll screw up; if I do, please provide constructive feedback.
In Greece, Mesopotamia, Carthage, Egypt, Rome, slaves were widely traded and used in a chattel slavery system for economic purposes. The slaves did not typically have rights and could be very poorly treated or even killed. Highly skilled slaves were treated better and more likely to earn their freedom, because threats of violence alone cannot make someone be a good business manager, trader, artisan or craftsman.
Slavery was very profitable, but it was not economically efficient. This seems a bit paradoxical.
EDIT-this had a confusing error equating slaves and serfs:
Slavery is the most efficient if you use a manorial form of agriculture, even though it is less efficient than free labor farming on small farms. (Meaning that tenant farmers and serfs, as not technically slaves, are less efficient than slaves. In other words, people must own their land and own what they produce to be productive or they are disincentivized. Slaves are made to be productive through violence, which can't be used on a serf.) The proof for this idea comes from the numerous emancipations of serfs or slaves throughout history. Agricultural production will fall by nearly half in the first few years as a result of the upheaval but will soon recover and greatly overtake the past production levels if land ownership is implemented.
In civilizations where land is the measure of wealth, there is a tendency for the wealthy to buy up all the land. Rome for example divided its official class structures by the amount of land someone owned. When Rome started winning many wars, there was a greater and greater gap between rich and poor, and the rich were able to establish a plantation system (latifundia referred to in the other answer). So, therefore, even before industrialization, slavery is less efficient. It's more of a status symbol for the elite to make it just efficient enough for them to have plantations.
Debt slavery is also economically inefficient. In the American colonies, the consistently poor were sold into slavery to the lowest bidder for short periods of time, a year to five years, prior to the invention of poor houses. There was limited charity and government aid, but some people needed long term assistance. It was a consistent problem that these slaves would not be able to bring enough income for the master and thus were often very poorly treated, not given enough food and basic clothing. The intention was to improve the lot of the poor person who was likely begging for food in the street, but the system obviously failed. It makes a bit of sense that those who are poor have low earning potential, since many would be elderly or suffer from disabilities. For what its worth, the Romans actually did ban debt slavery. Broadly allowing it probably has really negative economic effects, such as increasing parasitic lending practices and bad business investments.